<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>智能养殖远程管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <!-- <link rel="shortcut icon" href="../logo.png" /> -->
    <link rel="stylesheet" href="../plugins/layui/css/layui.css?v=${.Config.basic.version}" media="all">
    <link rel="stylesheet" href="../plugins/layui/css/style.css?v=${.Config.basic.version}" media="all">
    <!-- <link rel="stylesheet" href="../layuiadmin/style/admin.css?v=${.Config.basic.version}" media="all"> -->
    <link rel="stylesheet" href="../plugins/zTree/css/metroStyle/metroStyle.css?v=${.Config.basic.version}">
    <link rel="stylesheet" href="../plugins/zTree/css/metroStyle/ext.css?v=${.Config.basic.version}">
    <link rel="stylesheet" href="//at.alicdn.com/t/c/font_3564966_a6tt4yhnzge.css" media="all">
    <link rel="stylesheet" href="../plugins/toastr/toastr.min.css?v=${.Config.basic.version}">
    <style>

        .layui-form-item .layui-input-inline {
            float: left;
            width: 130px;
            margin-right: 10px;
        }
        .layui-form-item {
            margin-top: 5px;
            margin-bottom: 5px;
        }

        .layui-btn + .layui-btn {
            margin-left: 5px;
        }
        .layui-btn-xs {
            height: 18px;
            line-height: 18px;
            padding: 0 5px;
            font-size: 11px;
        }

        .layui-form-label-lg {
            float: left;
            display: block;
            padding: 9px 15px;
            width: 150px;
            font-weight: 400;
            line-height: 20px;
            text-align: right;
        }

        /*.layui-form-item .layui-input[readonly] {*/
        /*    background-color: #0a1434;*/
        /*    color: #a6b8d5;*/
        /*    border: none;*/
        /*    border-top-color: currentcolor;*/
        /*    border-right-color: currentcolor;*/
        /*    border-bottom-color: currentcolor;*/
        /*    border-left-color: currentcolor;*/
        /*}*/
        .layui-btn-normal {
            background-color: transparent;
        }
    </style>

    <style>
        .layui-table-view .layui-table td, .layui-table-view .layui-table th {
            padding: 5px 0;
            border-top: 1px solid #404453;
            border-left: 1px solid #404453;
            border-bottom: 1px solid #404453;
            border-right: 1px solid #404453;
        }
        .layui-table tbody tr:hover, .layui-table thead tr, .layui-table-header, .layui-table-hover, .layui-table-mend, .layui-table-patch, .layui-table-total, .layui-table-total tr, .layui-table[lay-even] tr:nth-child(2n) {
            background-color: transparent !important;
        }
        .layui-table[lay-size="sm"] td, .layui-table[lay-size="sm"] th {
            font-size: 12px;
            padding: 2px 2px;
        }
        .layui-table td, .layui-table th, .layui-table-col-set, .layui-table-fixed-r, .layui-table-grid-down, .layui-table-header, .layui-table-page, .layui-table-tips-main, .layui-table-tool, .layui-table-total, .layui-table-view, .layui-table[lay-skin="line"], .layui-table[lay-skin="row"] {
            border-width: 1px;
            border-style: dotted;
            border-color: #000;
        }
        .layui-table {
            width: auto !important;
            background-color: #eee;
            color: #899eb2;
        }
        [v-clock]{
            display: none;
        }

        .style-select{
            height: 34px;
            line-height: 34px;
            background-color: #fff;
            color: #8f97b3;
            border-radius: 5px;
            border: 0px solid #6c7492;
        }
        
    </style>
    <style>
        /*以下修改layui 时间范围选择器去掉秒显示的样式*/
        .layui-laydate-content>.layui-laydate-list {padding-bottom: 0px;overflow: hidden }
        .layui-laydate-content>.layui-laydate-list>li {width:50%}
        .merge-box .scrollbox .merge-list {
            padding-bottom:5px;
        }
        .laydate-time-list li {width:100%;padding-left:0;text-align: center};
    </style>

    <!-- <style>
        /*白色模式*/
        html{
            background-color: #fafafa;
        }
        .bg-panel {
            border-radius: 5px;
            border: 2px solid #000;
            min-height: 100px;
        }
        .layui-input, .layui-select, .layui-textarea {
            height: 34px;
            line-height: 34px;
            border-width: 1px;
            border-style: solid;
            background-color: #eee;
            color: #000;
            border-radius: 5px;
            border: 0px solid #6c7492;
            border-top-color: rgb(108, 116, 146);
            border-right-color: rgb(108, 116, 146);
            border-bottom-color: rgb(108, 116, 146);
            border-left-color: rgb(108, 116, 146);
        }
        .layui-table {
            width: auto !important;
            background-color: #fff;
            color: #000;
        }
        .layui-form-label-lg {
            float: left;
            display: block;
            padding: 9px 15px;
            width: 150px;
            font-weight: 400;
            line-height: 20px;
            text-align: right;
            color: #000;
        }
        .layui-table td, .layui-table th, .layui-table-col-set, .layui-table-fixed-r, .layui-table-grid-down, .layui-table-header, .layui-table-page, .layui-table-tips-main, .layui-table-tool, .layui-table-total, .layui-table-view, .layui-table[lay-skin="line"], .layui-table[lay-skin="row"] {
            border-width: 1px;
            border-style: solid;
            border-color: #000;
        }
        .layui-input-green {
            color: #337c00 !important;
            font-weight: bold;
        }
        .layui-input, .layui-textarea {
            display: block;
            width: 100%;
            padding-left: 5px;
        }
        .layui-input[readonly] {
            background-color: #fff !important;
            border: 0;
        }
        .layui-form-item .layui-input[readonly] {
            background-color: #fafafa !important;
            color: #000;
        }

        select{
            background-color: #eee !important;
            color: #000 !important;
            border-radius: 3px !important;
            border: 1px solid #aaa !important;
        }
        .layui-form-select dl {
            background-color: #eee;
            border: 0px;
        }
        .layui-input, .layui-select, .layui-textarea {
            height: 34px;
            line-height: 34px;
            border-width: 1px;
            border-style: solid;
            background-color: #f0f0f0;
            color: #000;
            border-radius: 3px;
            border: 1px solid #aaa;
                border-top-color: rgb(170, 170, 170);
                border-right-color: rgb(170, 170, 170);
                border-bottom-color: rgb(170, 170, 170);
                border-left-color: rgb(170, 170, 170);
            border-top-color: #aaa;
            border-right-color: #aaa;
            border-bottom-color: #aaa;
            border-left-color: #aaa;
        }
        .panel-title {
            font-size: 14px;
            color: #4958b9;
            line-height: 40px;
            font-weight: bold;
        }
        
    </style> -->
</head>
<body class="layui-layout-body">
    <div class="">
        <div style="padding: 5px;">
            <div class="node_para" style="display: none;" v-clock>

                <div class="bg-panel">
                    <div class="panel-header">

                        <span class="panel-title ">
                            <span class="layui-badge-dot layui-bg-olive"></span> 
                            <span class="layui-text-xs ">方案</span>
                        </span>
                    </div>

                    <form  class="layui-form" id="form_plan" lay-filter="form_plan">
                        <div class="layui-form-item">
                            
                            <div class="layui-inline">
                                <label class="layui-form-label-lg layui-form-label-sm"><span class="layui-text-red">*</span> 集团</label>
                                <div class="layui-input-inline">
                                    <select  name="group_code" lay-filter="group_code" lay-verify="required" lay-search=""  >
                                        <option value=""></option>
                                    </select>
                                </div>
                            </div>

                            <div class="layui-inline">
                                <label class="layui-form-label-lg layui-form-label-sm"> 场区</label>
                                <div class="layui-input-inline">
                                    <select  name="farmid" lay-filter="farmid" lay-verify="" lay-search=""  >
                                        <option value=""></option>
                                    </select>
                                </div>
                            </div>

                            <div class="layui-inline">
                                <label class="layui-form-label-lg layui-form-label-sm"><span class="layui-text-red">*</span> 方案名称</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="name"  v-model="name" placeholder="请勿随意填写" name="" lay-verify="required" lay-verType="tips" autocomplete="off" class="layui-input">
                                </div>
                            </div>

                            <div class="layui-inline">
                                <label class="layui-form-label-lg layui-form-label-sm"> 备注</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="remark" v-model="remark"  placeholder="" name="" lay-verify="required" lay-verType="tips" autocomplete="off" class="layui-input">
                                </div>
                            </div>

                            <!-- <div class="layui-inline" v-show="is_admin">
                                <label class="layui-form-label-lg layui-form-label-sm">饲料类型</label>
                                <div class="layui-input-inline">
                                    <select  name="food_type" lay-filter="food_type" lay-verify="" lay-search=""  >
                                        <option value=""></option>
                                        <option value="粉料">粉料</option>
                                        <option value="颗粒料">颗粒料</option>
                                    </select>
                                </div>
                            </div> -->

                            <!-- <div class="layui-inline" v-show="is_admin">
                                <label class="layui-form-label-lg layui-form-label-sm">饲料方案</label>
                                <div class="layui-input-inline">
                                    <select  name="food_plan" lay-filter="food_plan" lay-verify="" lay-search=""  >
                                        <option value=""></option>
                                        <option value="空怀饲料">空怀饲料</option>
                                        <option value="妊娠饲料">妊娠饲料</option>
                                        <option value="哺乳饲料">哺乳饲料</option>
                                        <option value="教槽料">教槽料</option>
                                        <option value="保育料">保育料</option>
                                        <option value="育肥料">育肥料</option>
                                        <option value="公猪料">公猪料</option>
                                    </select>
                                </div>
                            </div> -->
                        </div>
                    </form>
                    
                </div>

                <div class="bg-panel">
                    <div class="panel-header">

                        <span class="panel-title ">
                            <span class="layui-badge-dot layui-bg-olive"></span> 
                            <span class="layui-text-xs ">基本参数</span>
                        </span>
                        <!-- <span onclick="onSaveLgNode()" class=" fr hand layui-text-sm layui-text-mute radius" style="margin: 5px;"><i class="layui-icon close-btn layui-icon-download-circle layui-text-green mr-sm"></i></span> -->
                    </div>

                    <form  class="layui-form" id="form_node_param" lay-filter="form_node_param">
                        <div class="layui-form-item">
                            <!-- <div class="layui-inline">
                                <label class="layui-form-label-lg layui-form-label-sm">是否启用</label>
                                <div class="layui-input-inline">
                                    <input type="checkbox"  checked="" lay-skin="switch" lay-text="启用|关闭" name="_Enable">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label-lg layui-form-label-sm">SN序列号</label>
                                <div class="layui-input-inline">
                                    <input type="text"  v-model="node_para.Sn" placeholder="10位SN序列号" name=""  lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label-lg layui-form-label-sm">栏位编号</label>
                                <div class="layui-input-inline">
                                    <input type="text"  v-model="node_para.Hnum" id="Hnum" placeholder="AXXX" name="" lay-verify="required" lay-verType="tips" autocomplete="off" class="layui-input">
                                </div>
                            </div>-->

                            

                            <div class="layui-inline">
                                <label class="layui-form-label-lg layui-form-label-sm">模式</label>
                                <div class="layui-input-inline">
                                    <!-- <select lay-ignore  v-model="node_para.Mode" name="Mode" lay-filter="Mode" lay-verify="required" lay-search=""  >
                                        <option value="0">停用</option>
                                        <option value="1">妊娠</option>
                                        <option value="2">哺乳</option>
                                        <option value="3">保育</option>
                                        <option value="4">育肥</option>
                                        <option value="5">定时下料</option>
                                    </select> -->
                                    <!-- <select name="Mode" lay-filter="Mode" lay-verify="required" lay-search=""  >
                                        <option value="0">停用</option>
                                        <option value="1">妊娠</option>
                                        <option value="2">哺乳</option>
                                        <option value="3">保育</option>
                                        <option value="4">育肥</option>
                                        <option value="5">定时下料</option>
                                    </select> -->
                                    <!-- <input v-if="node_para.Mode==1" type="text" readonly value="妊娠"  placeholder="" name="" lay-verify="" lay-verType="tips" autocomplete="off" class="layui-input"> -->
                                    <!-- <input v-if="node_para.Mode==2" type="text" readonly value="哺乳"  placeholder="" name="" lay-verify="" lay-verType="tips" autocomplete="off" class="layui-input"> -->
                                    <select v-if="node_para.Mode==1 || node_para.Mode==2" lay-ignore style="height: 34px;
                                        width: 130px;
                                        background-color: #fff;
                                        color: #8f97b3;
                                        border: 1px solid #3c7cff;
                                        border-radius: 5px;"  v-model="node_para.Mode"   >
                                            <option  value="1">妊娠</option>
                                            <option  value="2">哺乳</option>
                                    </select>
                                    <input v-if="node_para.Mode==3" type="text" readonly value="保育"  placeholder="" name="" lay-verify="" lay-verType="tips" autocomplete="off" class="layui-input">
                                    <input v-if="node_para.Mode==4" type="text" readonly value="育肥"  placeholder="" name="" lay-verify="" lay-verType="tips" autocomplete="off" class="layui-input">
                                </div>
                            </div>

                            <!-- <div class="layui-inline">
                                <label class="layui-form-label-lg layui-form-label-sm">日龄</label>
                                <div class="layui-input-inline">
                                    <input type="text"  v-model="node_para.Gday" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                </div>
                            </div> -->

                            <div class="layui-inline">
                                <label class="layui-form-label-lg layui-form-label-sm">有余料AD值</label>
                                <div class="layui-input-inline">
                                    <input type="text"  v-model="node_para.CalAD" placeholder="" name="" lay-verify="number" maxlength="4" lay-verType="tips" autocomplete="off" class="layui-input">
                                </div>
                            </div>

                            <div class="layui-inline">
                                <label class="layui-form-label-lg layui-form-label-sm">无余料AD值</label>
                                <div class="layui-input-inline">
                                    <input type="text"  v-model="node_para.CalADR" placeholder="" name="" lay-verify="number" maxlength="4" lay-verType="tips" autocomplete="off" class="layui-input">
                                </div>
                            </div>

                            <div class="layui-inline">
                                <label class="layui-form-label-lg layui-form-label-sm">10圈出料(g)</label>
                                <div class="layui-input-inline">
                                    <input type="text" v-model="node_para.CalFeed" placeholder="" name="" lay-verify="number" maxlength="5" lay-verType="tips" autocomplete="off" class="layui-input">
                                </div>
                            </div>

                            <div class="layui-inline">
                                <label class="layui-form-label-lg layui-form-label-sm">1L水对应的脉冲数</label>
                                <div class="layui-input-inline">
                                    <!-- <input type="text" v-model="node_para.PulseWater" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input"> -->
                                    <select lay-ignore style="height: 34px;
                                    width: 130px;
                                    background-color: #fff;
                                    color: #8f97b3;
                                    border: 1px solid #3c7cff;
                                    border-radius: 5px;"  v-model="node_para.PulseWater"   >
                                        <option  value="520">520</option>
                                        <option  value="1200">1200</option>
                                    </select>
                                </div>
                            </div>

                            

                            <div class="layui-inline" v-show="is_admin">
                                <label class="layui-form-label-lg layui-form-label-sm">水阀</label>
                                <div class="layui-input-inline">
                                    <input type="checkbox"  checked="" lay-skin="switch" lay-text="启用|禁用" name="_EnWater">
                                </div>
                            </div>

                            <div class="layui-inline " v-show="mode!=3 && mode!=4 && mode!=5 && is_admin">
                                <label class="layui-form-label-lg layui-form-label-sm">触碰杆</label>
                                <div class="layui-input-inline">
                                    <input type="checkbox"  checked="" lay-skin="switch" lay-text="启用|禁用" name="_EnTB" lay-filter="_EnTB">
                                </div>
                            </div>

                            <!-- <div class="layui-inline" v-show="is_admin">
                                <label class="layui-form-label-lg layui-form-label-sm">反转次数</label>
                                <div class="layui-input-inline">
                                    <input type="text"  v-model="node_para.ReverseTimes" placeholder="1-10" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline" v-show="is_admin">
                                <label class="layui-form-label-lg layui-form-label-sm">反转圈数</label>
                                <div class="layui-input-inline">
                                    <input type="text"  v-model="node_para.ReverseTurns" placeholder="1.0-10.0" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                </div>
                            </div> -->

                            <div class="layui-inline" >
                                <label class="layui-form-label-lg layui-form-label-sm">延时下水时间(秒) <i class="layui-icon layui-icon-tips layui-text-white layui-text-sm" lay-tips="下料开始多少秒后开始下水" lay-offset="0"></i></label>
                                <div class="layui-input-inline">
                                    <input type="text"  v-model="node_para.WaterDelay" placeholder="0-30" @input="validate_int(0,30,event)" maxlength="2" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline" v-show="is_admin">
                                <label class="layui-form-label-lg layui-form-label-sm">下料/水保护延长时间(分)</label>
                                <div class="layui-input-inline">
                                    <input type="text"  v-model="node_para.PtTimeDelay" placeholder="0-30" @input="validate_int(0,30,event)" maxlength="2" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                </div>
                            </div>

                            <div class="layui-inline" v-show="1==1">
                                <label class="layui-form-label-lg layui-form-label-sm">手动出料(g)</label>
                                <div class="layui-input-inline">
                                    <input type="text"  v-model="node_para.ManOut" @input="validate_int(0,500,event)" placeholder="≤500" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline" v-show="1==1">
                                <label class="layui-form-label-lg layui-form-label-sm">手动出水(ml)</label>
                                <div class="layui-input-inline">
                                    <input type="text"  v-model="node_para.ManWaterOut" @input="validate_int(0,1000,event)" placeholder="≤1000" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                </div>
                            </div>

                            

                            <div class="layui-inline" v-show="(mode==1||mode==2) && enTB && is_admin">
                                <label class="layui-form-label-lg layui-form-label-sm">泌乳模式 无触碰超时(分)</label>
                                <div class="layui-input-inline">
                                    <input type="text" v-model="node_para.Mr_notbTo" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                </div>
                            </div>

                            <div class="layui-inline" v-show="(mode==1||mode==2) && is_admin">
                                <label class="layui-form-label-lg layui-form-label-sm">泌乳模式 强制出水(L) <i class="layui-icon layui-icon-tips layui-text-white layui-text-sm" lay-tips="采食结束后强制出水量" lay-offset="0"></i></label>
                                <div class="layui-input-inline">
                                    <input type="text" v-model="node_para.Mr_forceWater" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                </div>
                            </div>

                            <div class="layui-inline" v-show="(mode==1||mode==2) && is_admin">
                                <label class="layui-form-label-lg layui-form-label-sm">泌乳模式 清槽时间(分)</label>
                                <div class="layui-input-inline">
                                    <input type="text" v-model="node_para.Mr_clearTO" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                </div>
                            </div>

                            <!-- <div v-if="node_para.TbPTime" v-show="(mode==1||mode==2) && enTB && is_admin" class="layui-inline" >
                                <label class="layui-form-label-lg layui-form-label-sm">300g 触碰杆保护时间(秒)</label>
                                <div class="layui-input-inline">
                                    <input type="text" v-model="node_para.TbPTime[0]" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                </div>
                            </div>

                            <div v-if="node_para.TbPTime" v-show="(mode==1||mode==2) && enTB && is_admin" class="layui-inline">
                                <label class="layui-form-label-lg layui-form-label-sm">500g 触碰杆保护时间(秒)</label>
                                <div class="layui-input-inline">
                                    <input type="text" v-model="node_para.TbPTime[1]" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                </div>
                            </div>

                            <div v-if="node_para.TbPTime" v-show="(mode==1||mode==2) && enTB && is_admin" class="layui-inline">
                                <label class="layui-form-label-lg layui-form-label-sm">1kg 触碰杆保护时间(秒)</label>
                                <div class="layui-input-inline">
                                    <input type="text" v-model="node_para.TbPTime[2]" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                </div>
                            </div> -->

                            <div class="layui-inline" v-show="(mode==1||mode==2) ">
                                <label class="layui-form-label-lg layui-form-label-sm">提前退出补水时间(分) <i class="layui-icon layui-icon-tips layui-text-white layui-text-sm" lay-tips="差多少分钟到饲喂时段就不补水" lay-offset="0"></i></label>
                                <div class="layui-input-inline">
                                    <input type="text" v-model="node_para.CwExitTime" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                </div>
                            </div>

                            <div class="layui-inline" v-show="(mode==1||mode==2||mode==3||mode==4) && is_admin">
                                <label class="layui-form-label-lg layui-form-label-sm">水阀没脉冲保护时间(秒) <i class="layui-icon layui-icon-tips layui-text-white layui-text-sm" lay-tips="水阀在多久没有感应到脉冲或者不足就报警(水压不足或者脉冲坏)" lay-offset="0"></i></label>
                                <div class="layui-input-inline">
                                    <input type="text" v-model="node_para.WaterPTTO" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                </div>
                            </div>

                            <div class="layui-inline" v-show="mode==3">
                                <label class="layui-form-label-lg layui-form-label-sm">保育自动切换育肥</label>
                                <div class="layui-input-inline">
                                    <input type="checkbox"  checked="" lay-skin="switch" lay-text="启用|禁用" name="_EnAutoSwitchGrowthMode" lay-filter="_EnAutoSwitchGrowthMode">
                                </div>
                            </div>

                            <div class="layui-inline" v-show="(mode==1||mode==2) && is_admin">
                                <label class="layui-form-label-lg layui-form-label-sm">首次触碰当诱食处理</label>
                                <div class="layui-input-inline">
                                    <input type="checkbox"  checked="" lay-skin="switch" lay-text="启用|禁用" name="_EnFirstTouchAsFirstFeed">
                                </div>
                            </div>

                            <div class="layui-inline" v-show="1==1">
                                <label class="layui-form-label-lg layui-form-label-sm">电机过流保护</label>
                                <div class="layui-input-inline">
                                    <input type="checkbox"  checked="" lay-skin="switch" lay-text="启用|禁用" name="_EnMotorCurProtect">
                                </div>
                            </div>

                            <div class="layui-inline" v-show="is_admin">
                                <label class="layui-form-label-lg layui-form-label-sm">电机空载检测</label>
                                <div class="layui-input-inline">
                                    <input type="checkbox"  checked="" lay-skin="switch" lay-text="启用|禁用" name="_EnMotorCurIdle">
                                </div>
                            </div>

                            <div class="layui-inline" v-show="is_admin">
                                <label class="layui-form-label-lg layui-form-label-sm">空载电流(mA)</label>
                                <div class="layui-input-inline">
                                    <input type="text" v-model="node_para.CurIdle" placeholder="1-255" maxlength="3" @input="validate_int(1,255,event)" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                </div>
                            </div>

                            <div class="layui-inline">
                                <label class="layui-form-label-lg layui-form-label-sm">增加减少饲喂量 <i class="layui-icon layui-icon-tips layui-text-white layui-text-sm" lay-tips="饲喂量偏移量，可以为正负值" lay-offset="0"></i></label>
                                <div class="layui-input-inline">
                                    <input type="text" v-model="node_para.FeedOffset" maxlength="2" @input="validate_int(-5,5,event)" placeholder="" name="" lay-verify="number" lay-verType="tips" autocomplete="off" class="layui-input">
                                </div>
                                <label class="layui-form-label layui-form-label-xs">x100g</label>
                            </div>

                        </div>
                    </form>
                    
                </div>



                <div class="plan" >

                    <div v-show="(mode==1||mode==2)" class="bg-panel mr-top-md" >
                        <div class="panel-header pd-md">
                            <span class="panel-title ">
                                <span class="layui-badge-dot layui-bg-olive"></span> 
                                <span class="layui-text-xs ">妊娠阶段参数</span>

                                <button type="button" @click="onApplyDefault();" class="action-edit layui-hide  radius-10  mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class=" layui-icon close-btn layui-icon-release layui-text-white mr-sm"></i> 使用默认</button>
                                <button type="button" @click="onClearAll();" class="action-edit radius-10  mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon close-btn layui-icon-close layui-text-white mr-sm"></i> 清空</button>
                            </span>
                        </div>
                        <div class="mr-md" style="overflow: auto;">
                            <table class="layui-table" lay-size="sm">
                                <colgroup>
                                    <col width="40">
                                    <col width="50">
                                    <col width="40">
                                    <col width="40">

                                    <col width="90">
                                    <col width="40" >
                                    <col width="40">

                                    <col width="90">
                                    <col width="40" >
                                    <col width="40">

                                    <col width="90">
                                    <col width="40" >
                                    <col width="40">

                                    <col width="90">
                                    <col width="40" >
                                    <col width="40">

                                    <col width="90">
                                    <col width="40" >
                                    <col width="40">

                                    <col width="90">
                                    <col width="40" >
                                    <col width="40">

                                    <col width="40" v-show="enTB && 1==1">
                                    <col width="40" v-show="enTB && 1==1" >
                                    <col width="40" v-show="enTB && 1==1">
                                    <col width="40" v-show="1==1">
                                    <col width="40" v-show="1==1">
                                    <col width="40" v-show="!enTB && 1==1">
                                    <col width="40" v-show="!enTB && 1==1">

                                    <col width="60" v-show="enTB && is_admin">
                                    <col width="60" v-show="enTB && is_admin">
                                    <col width="60" v-show="enTB && is_admin">
                                    <col width="60" v-show="enTB && is_admin">
                                    <col width="60" v-show="enTB && is_admin">
                                    <col width="60" v-show="enTB && is_admin">
                                </colgroup>
                                <thead>
                                    <tr>
                                        <th class="center" colspan="1" rowspan="3">日龄</th>
                                        <th class="center" colspan="1" rowspan="3">日总料量</th>
                                        <th class="center" colspan="1" rowspan="3">水料比</th>
                                        <th class="center" colspan="1" rowspan="3">餐数</th>

                                        <th class="center"  colspan="18" rowspan="1">每餐下料(下料单位kg)</th>
                                        <!-- <th class="center" v-else colspan="12" rowspan="1">每餐下料(下料单位kg)</th> -->

                                        <th class="center" colspan="1" rowspan="3" v-show="enTB && 1==1">诱食下料(kg)</th>
                                        <th class="center" colspan="1" rowspan="3" v-show="enTB && 1==1">首次触碰下料(kg)</th>
                                        <th class="center" colspan="1" rowspan="3" v-show="enTB && 1==1">触碰下料(kg)</th>
                                        <!-- <th class="center" colspan="1" rowspan="3" v-show="1==1">下水保护时间(分)</th> -->
                                        <th class="center" colspan="1" rowspan="3" >
                                            下水保护时间 单位:
                                            <select lay-ignore style="height: 15px;
                                                font-size: 11px;
                                                background-color: #ffffff;
                                                color: #000000;
                                                border: 0px;
                                                "  v-model="wp_unit"   >
                                                    <option  value="0">分</option>
                                                    <option  value="1">秒</option>
                                            </select>
                                        </th>
                                        <th class="center" colspan="1" rowspan="3" v-show="1==1">单次补水量(L)</th>
                                        <th class="center" colspan="1" rowspan="3" v-show="!enTB && 1==1">单次下料量(kg)</th>
                                        <th class="center" colspan="1" rowspan="3" v-show="!enTB && 1==1">自动出料保护时间(分)</th>

                                        <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">诱食下料是否下水</th>
                                        <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">整个时间段内未主动有效触碰退出</th>
                                        <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">15分钟未触碰退出</th>
                                        <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">智能未触碰退出</th>
                                        <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">吃完退出</th>
                                        <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">首次补水强制出水</th>

                                        <th class="center" colspan="1" rowspan="3">重置</th>
                                        
                                        <!-- <th><span @click="" class="layui-hide  fr hand layui-text-sm layui-text-mute radius" style="margin-right: 5px;"><i class="layui-icon close-btn layui-icon-add-circle layui-text-main-color mr-sm" style="font-size: 18px;"></i></span></th> -->
                                    </tr>

                                    <tr>
                                        <th class="center" colspan="3" rowspan="1">第1餐</th>
                                        <th class="center" colspan="3" rowspan="1">第2餐</th>
                                        <th class="center" colspan="3" rowspan="1">第3餐</th>
                                        <th class="center" colspan="3" rowspan="1">第4餐</th>
                                        <th class="center" colspan="3" rowspan="1">第5餐</th>
                                        <th class="center" colspan="3" rowspan="1">第6餐</th>
                                    </tr>

                                    <tr>
                                        <th class="center">时间</th>
                                        <th class="center" >诱食</th>
                                        <th class="center">下料</th>
                                        

                                        <th class="center">时间</th>
                                        <th class="center" >诱食</th>
                                        <th class="center">下料</th>
                                        

                                        <th class="center">时间</th>
                                        <th class="center" >诱食</th>
                                        <th class="center">下料</th>
                                        

                                        <th class="center">时间</th>
                                        <th class="center" >诱食</th>
                                        <th class="center">下料</th>
                                        

                                        <th class="center">时间</th>
                                        <th class="center" >诱食</th>
                                        <th class="center">下料</th>
                                        

                                        <th class="center">时间</th>
                                        <th class="center" >诱食</th>
                                        <th class="center">下料</th>
                                        
                                    </tr>

                                    
                                </thead>
                                <tbody>
                                    <form  class="layui-form" id="form_pg_param" lay-filter="form_pg_param">
                                        <template  v-for="(item,idx) in Pg_para">
                                            <tr>
                                                <td >
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="text" v-model="item.Pg_gday" @input="on_Pg_gday(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                            class="layui-input" style="width: 40px">
                                                    </div>
                                                </td>
                                                <td >
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="text" v-model="item.Pg_total_feed" readonly name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                            class="layui-input" :class="item.Pg_total_feed>0?'layui-input-green':''" style="width: 40px">
                                                    </div>
                                                </td>
                                                <td >
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="text" v-model="item.Pg_waterFeed" @input="on_Pg_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                            class="layui-input" :class="item.Pg_waterFeed>0?'layui-input-green':''" style="width: 40px">
                                                    </div>
                                                </td>
                                                <td >
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="text" v-model="item.Pg_feed_num" readonly name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                            class="layui-input" :class="item.Pg_feed_num>0?'layui-input-green':''" style="width: 40px">
                                                    </div>
                                                </td>

                                                <td>
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="text" :id="'Pg_time-'+idx+'-0'" :idx="idx" :idx1="0" v-model="item.Pg_time[0]" @input="on_Pg_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                            class="layui-input Pg_time" :class="item.Pg_time[0]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                    </div>
                                                </td>
                                                <td >
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="checkbox" v-model="item.Pg_rev_bits[0]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Pg_rev_bits0">
                                                    </div>
                                                </td>
                                                <td >
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="text" v-model="item.Pg_outT[0]"  @input="onPg_outT(idx,0,event)"  name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                            class="layui-input" :class="item.Pg_outT[0]>0?'layui-input-green':''" style="width: 40px">
                                                    </div>
                                                </td>
                                                


                                                <td >
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="text" :id="'Pg_time-'+idx+'-1'" :idx="idx" :idx1="1" v-model="item.Pg_time[1]" v-model="item.Pg_time[1]" @input="on_Pg_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                            class="layui-input Pg_time" :class="item.Pg_time[1]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                    </div>
                                                </td>
                                                <td >
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="checkbox" v-model="item.Pg_rev_bits[1]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Pg_rev_bits1">
                                                    </div>
                                                </td>
                                                <td >
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="text" v-model="item.Pg_outT[1]" @input="onPg_outT(idx,1,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                            class="layui-input" :class="item.Pg_outT[1]>0?'layui-input-green':''" style="width: 40px">
                                                    </div>
                                                </td>
                                                

                                                <td >
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="text" :id="'Pg_time-'+idx+'-2'" :idx="idx" :idx1="2"  v-model="item.Pg_time[2]" @input="on_Pg_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                            class="layui-input Pg_time" :class="item.Pg_time[2]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                    </div>
                                                </td>
                                                <td >
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="checkbox" v-model="item.Pg_rev_bits[2]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Pg_rev_bits2">
                                                    </div>
                                                </td>
                                                <td >
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="text" v-model="item.Pg_outT[2]" @input="onPg_outT(idx,2,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                            class="layui-input" :class="item.Pg_outT[2]>0?'layui-input-green':''" style="width: 40px">
                                                    </div>
                                                </td>
                                                

                                                <td >
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="text" :id="'Pg_time-'+idx+'-3'" :idx="idx" :idx1="3" v-model="item.Pg_time[3]" @input="on_Pg_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                            class="layui-input Pg_time" :class="item.Pg_time[3]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                    </div>
                                                </td>
                                                <td >
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="checkbox" v-model="item.Pg_rev_bits[3]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Pg_rev_bits3">
                                                    </div>
                                                </td>
                                                <td >
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="text" v-model="item.Pg_outT[3]" @input="onPg_outT(idx,3,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                            class="layui-input" :class="item.Pg_outT[3]>0?'layui-input-green':''" style="width: 40px">
                                                    </div>
                                                </td>
                                                

                                                <td >
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="text" :id="'Pg_time-'+idx+'-4'" :idx="idx" :idx1="4" v-model="item.Pg_time[4]" @input="on_Pg_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                            class="layui-input Pg_time" :class="item.Pg_time[4]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                    </div>
                                                </td>
                                                <td >
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="checkbox" v-model="item.Pg_rev_bits[4]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Pg_rev_bits4">
                                                    </div>
                                                </td>
                                                <td >
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="text" v-model="item.Pg_outT[4]" @input="onPg_outT(idx,4,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                            class="layui-input" :class="item.Pg_outT[4]>0?'layui-input-green':''" style="width: 40px">
                                                    </div>
                                                </td>
                                                

                                                <td>
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="text" :id="'Pg_time-'+idx+'-5'" :idx="idx" :idx1="5" v-model="item.Pg_time[5]" @input="on_Pg_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                            class="layui-input Pg_time" :class="item.Pg_time[5]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px;">
                                                    </div>
                                                </td>
                                                <td >
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="checkbox" v-model="item.Pg_rev_bits[5]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Pg_rev_bits5">
                                                    </div>
                                                </td>
                                                <td>
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="text" v-model="item.Pg_outT[5]" @input="onPg_outT(idx,5,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                            class="layui-input" :class="item.Pg_outT[5]>0?'layui-input-green':''" style="width: 40px;">
                                                    </div>
                                                </td>

                                                <td v-show="enTB && 1==1">
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="text" v-model="item.Pg_firstFeed"  name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                            class="layui-input"  style="width: 40px;">
                                                    </div>
                                                </td>

                                                <td v-show="enTB && 1==1">
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="text" v-model="item.Pg_ftbFeed"  name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                            class="layui-input"  style="width: 40px;">
                                                    </div>
                                                </td>

                                                <td v-show="enTB && 1==1">
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="text" v-model="item.Pg_tbFeed"  name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                            class="layui-input"  style="width: 40px;">
                                                    </div>
                                                </td>

                                                <td v-show="1==1">
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="text" v-model="item.Pg_wgapTime"  name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                            class="layui-input"  style="width: 40px;">
                                                    </div>
                                                </td>

                                                <td v-show="1==1">
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="text" v-model="item.Pg_cw"  name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                            class="layui-input"  style="width: 40px;">
                                                    </div>
                                                </td>

                                                <td v-show="!enTB && 1==1">
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="text" v-model="item.Pg_autoFeed"  name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                            class="layui-input"  style="width: 40px;">
                                                    </div>
                                                </td>

                                                <td v-show="!enTB && 1==1">
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="text" v-model="item.Pg_fgapTime"  name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                            class="layui-input"  style="width: 40px;">
                                                    </div>
                                                </td>

                                                <td v-show="enTB && is_admin">
                                                    <div  class="layui-input-inline" style="width: 100%;">
                                                        <input type="checkbox" v-model="item.Pg_flag_bits[0]" style="width: 60px;" checked="" lay-skin="switch" lay-text="是|否" name="_Pg_flag_bit0">
                                                    </div>
                                                </td>
                                                <td v-show="enTB && is_admin">
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="checkbox" v-model="item.Pg_flag_bits[1]" style="width: 60px;" checked="" lay-skin="switch" lay-text="是|否" name="_Pg_flag_bit1">
                                                    </div>
                                                </td>
                                                <td v-show="enTB && is_admin">
                                                    <div  class="layui-input-inline" style="width: 100%;">
                                                        <input type="checkbox" v-model="item.Pg_flag_bits[2]" style="width: 60px;" checked="" lay-skin="switch" lay-text="是|否" name="_Pg_flag_bit2">
                                                    </div>
                                                </td>
                                                <td v-show="enTB && is_admin">
                                                    <div class="layui-input-inline" style="width: 100%;">
                                                        <input type="checkbox" v-model="item.Pg_flag_bits[3]" style="width: 60px;" checked="" lay-skin="switch" lay-text="是|否" name="_Pg_flag_bit3">
                                                    </div>
                                                </td>
                                                <td v-show="enTB && is_admin">
                                                    <div  class="layui-input-inline" style="width: 100%;">
                                                        <input type="checkbox" v-model="item.Pg_flag_bits[4]" style="width: 60px;" checked="" lay-skin="switch" lay-text="是|否" name="_Pg_flag_bit4">
                                                    </div>
                                                </td>
                                                <td v-show="enTB && is_admin">
                                                    <div  class="layui-input-inline" style="width: 100%;">
                                                        <input type="checkbox" v-model="item.Pg_flag_bits[5]" style="width: 60px;" checked="" lay-skin="switch" lay-text="是|否" name="_Pg_flag_bit5">
                                                    </div>
                                                </td>

                                                <td >
                                                    <span style="display: block; width: 60px;" @click="onClearLine(item,idx);" class=" text-center action-edit hand layui-text-sm layui-text-mute radius" ><i class="layui-icon close-btn layui-icon-fonts-clear layui-text-orange-light mr-sm"></i></span>
                                                    <!-- <button type="button" @click="onClearAll();" class="action-edit radius-10 fr mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon close-btn layui-icon-close layui-text-white mr-sm"></i> 清空</button> -->
                                                    
                                                </td>
                                            </tr>
                                        </template>
                                    </form>
                                    
                                    
                                    
                                </tbody>
                            </table>
                        </div>

                        
                    </div>

                    <div v-show="(mode==1||mode==2)" class="bg-panel mr-top-md">
                        <div class="panel-header pd-md">
                            <span class="panel-title ">
                                <span class="layui-badge-dot layui-bg-olive"></span> 
                                <span class="layui-text-xs ">哺乳阶段参数</span>

                                <button type="button" @click="onApplyDefault();" class="action-edit layui-hide  radius-10  mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class=" layui-icon close-btn layui-icon-release layui-text-white mr-sm"></i> 使用默认</button>
                                        <button type="button" @click="onClearAll();" class="action-edit radius-10  mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon close-btn layui-icon-close layui-text-white mr-sm"></i> 清空</button>
                            </span>
                        </div>

                        <div class="mr-md" style="overflow: auto;">
                            <table class="layui-table" lay-size="sm">
                                <colgroup>
                                    <col width="40">
                                    <col width="50">
                                    <col width="40">
                                    <col width="40">

                                    <col width="90">
                                    <col width="40" >
                                    <col width="40">

                                    <col width="90">
                                    <col width="40" >
                                    <col width="40">

                                    <col width="90">
                                    <col width="40" >
                                    <col width="40">

                                    <col width="90">
                                    <col width="40" >
                                    <col width="40">

                                    <col width="90">
                                    <col width="40" >
                                    <col width="40">

                                    <col width="90">
                                    <col width="40" >
                                    <col width="40">

                                    <col width="40" v-show="enTB && 1==1">
                                    <col width="40" v-show="enTB && 1==1" >
                                    <col width="40" v-show="enTB && 1==1">
                                    <col width="40" v-show="1==1">
                                    <col width="40" v-show="1==1">
                                    <col width="40" v-show="!enTB && 1==1">
                                    <col width="40" v-show="!enTB && 1==1">

                                    <col width="60" v-show="enTB && is_admin">
                                    <col width="60" v-show="enTB && is_admin">
                                    <col width="60" v-show="enTB && is_admin">
                                    <col width="60" v-show="enTB && is_admin">
                                    <col width="60" v-show="enTB && is_admin">
                                    <col width="60" v-show="enTB && is_admin">
                                </colgroup>
                                <thead>
                                    <tr>
                                        <th class="center" colspan="1" rowspan="3">日龄</th>
                                        <th class="center" colspan="1" rowspan="3">日总料量</th>
                                        <th class="center" colspan="1" rowspan="3">水料比</th>
                                        <th class="center" colspan="1" rowspan="3">餐数</th>

                                        <th class="center"  colspan="18" rowspan="1">每餐下料(下料单位kg)</th>
                                        <!-- <th class="center" v-else colspan="12" rowspan="1">每餐下料(下料单位kg)</th> -->

                                        <th class="center" colspan="1" rowspan="3" v-show="enTB && 1==1">诱食下料(kg)</th>
                                        <th class="center" colspan="1" rowspan="3" v-show="enTB && 1==1">首次触碰下料(kg)</th>
                                        <th class="center" colspan="1" rowspan="3" v-show="enTB && 1==1">触碰下料(kg)</th>
                                        <!-- <th class="center" colspan="1" rowspan="3" v-show="1==1">下水保护时间(分)</th> -->
                                        <th class="center" colspan="1" rowspan="3" >
                                            下水保护时间 单位:
                                            <select lay-ignore style="height: 15px;
                                                font-size: 11px;
                                                background-color: #ffffff;
                                                color: #000000;
                                                border: 0px;
                                                "  v-model="wp_unit"   >
                                                    <option  value="0">分</option>
                                                    <option  value="1">秒</option>
                                            </select>
                                        </th>
                                        <th class="center" colspan="1" rowspan="3" v-show="1==1">单次补水量(L)</th>
                                        <th class="center" colspan="1" rowspan="3" v-show="!enTB && 1==1">单次下料量(kg)</th>
                                        <th class="center" colspan="1" rowspan="3" v-show="!enTB && 1==1">自动出料保护时间(分)</th>

                                        <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">诱食下料是否下水</th>
                                        <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">整个时间段内未主动有效触碰退出</th>
                                        <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">15分钟未触碰退出</th>
                                        <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">智能未触碰退出</th>
                                        <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">吃完退出</th>
                                        <th class="center" colspan="1" rowspan="3" v-show="enTB && is_admin">首次补水强制出水</th>

                                        <th class="center" colspan="1" rowspan="3">重置</th>
                                        
                                        <!-- <th><span @click="" class="layui-hide  fr hand layui-text-sm layui-text-mute radius" style="margin-right: 5px;"><i class="layui-icon close-btn layui-icon-add-circle layui-text-main-color mr-sm" style="font-size: 18px;"></i></span></th> -->
                                    </tr>

                                    <tr>
                                        <th class="center" colspan="3" rowspan="1">第1餐</th>
                                        <th class="center" colspan="3" rowspan="1">第2餐</th>
                                        <th class="center" colspan="3" rowspan="1">第3餐</th>
                                        <th class="center" colspan="3" rowspan="1">第4餐</th>
                                        <th class="center" colspan="3" rowspan="1">第5餐</th>
                                        <th class="center" colspan="3" rowspan="1">第6餐</th>
                                    </tr>

                                    <tr>
                                        <th class="center">时间</th>
                                        <th class="center" >诱食</th>
                                        <th class="center">下料</th>
                                        

                                        <th class="center">时间</th>
                                        <th class="center" >诱食</th>
                                        <th class="center">下料</th>
                                        

                                        <th class="center">时间</th>
                                        <th class="center" >诱食</th>
                                        <th class="center">下料</th>
                                        

                                        <th class="center">时间</th>
                                        <th class="center" >诱食</th>
                                        <th class="center">下料</th>
                                        

                                        <th class="center">时间</th>
                                        <th class="center" >诱食</th>
                                        <th class="center">下料</th>
                                        

                                        <th class="center">时间</th>
                                        <th class="center" >诱食</th>
                                        <th class="center">下料</th>
                                        
                                    </tr>

                                    
                                </thead>

                                <tbody>
                                    <template  v-for="(item,idx) in La_para">
                                        <tr>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.La_gday" @input="on_La_gday(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input" style="width: 40px">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.La_total_feed" readonly name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input" :class="item.La_total_feed>0?'layui-input-green':''" style="width: 50px">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.La_waterFeed" @input="on_La_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input" :class="item.La_waterFeed>0?'layui-input-green':''" style="width: 40px">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.La_feed_num" readonly name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input" :class="item.La_feed_num>0?'layui-input-green':''" style="width: 40px">
                                                </div>
                                            </td>

                                            <td>
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" :id="'La_time-'+idx+'-0'" :idx="idx" :idx1="0" v-model="item.La_time[0]" @input="on_La_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input La_time" :class="item.La_time[0]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="checkbox" v-model="item.La_rev_bits[0]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_La_rev_bits0">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.La_outT[0]" @input="onLa_outT(idx,0,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input" :class="item.La_outT[0]>0?'layui-input-green':''" style="width: 40px">
                                                </div>
                                            </td>
                                            


                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" :id="'La_time-'+idx+'-1'" :idx="idx" :idx1="1" v-model="item.La_time[1]" v-model="item.La_time[1]" @input="on_La_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input La_time" :class="item.La_time[1]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="checkbox" v-model="item.La_rev_bits[1]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_La_rev_bits1">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.La_outT[1]" @input="onLa_outT(idx,1,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input" :class="item.La_outT[1]>0?'layui-input-green':''" style="width: 40px">
                                                </div>
                                            </td>
                                            

                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" :id="'La_time-'+idx+'-2'" :idx="idx" :idx1="2"  v-model="item.La_time[2]" @input="on_La_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input La_time" :class="item.La_time[2]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="checkbox" v-model="item.La_rev_bits[2]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_La_rev_bits2">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.La_outT[2]" @input="onLa_outT(idx,2,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input" :class="item.La_outT[2]>0?'layui-input-green':''" style="width: 40px">
                                                </div>
                                            </td>
                                            

                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" :id="'La_time-'+idx+'-3'" :idx="idx" :idx1="3" v-model="item.La_time[3]" @input="on_La_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input La_time" :class="item.La_time[3]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="checkbox" v-model="item.La_rev_bits[3]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_La_rev_bits3">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.La_outT[3]" @input="onLa_outT(idx,3,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input" :class="item.La_outT[3]>0?'layui-input-green':''" style="width: 40px">
                                                </div>
                                            </td>
                                            

                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" :id="'La_time-'+idx+'-4'" :idx="idx" :idx1="4" v-model="item.La_time[4]" @input="on_La_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input La_time" :class="item.La_time[4]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="checkbox" v-model="item.La_rev_bits[4]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_La_rev_bits4">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.La_outT[4]" @input="onLa_outT(idx,4,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input" :class="item.La_outT[4]>0?'layui-input-green':''" style="width: 40px">
                                                </div>
                                            </td>
                                            

                                            <td>
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" :id="'La_time-'+idx+'-5'" :idx="idx" :idx1="5" v-model="item.La_time[5]" @input="on_La_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input La_time" :class="item.La_time[5]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px;">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="checkbox" v-model="item.La_rev_bits[5]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_La_rev_bits5">
                                                </div>
                                            </td>
                                            <td>
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.La_outT[5]" @input="onLa_outT(idx,5,event)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input" :class="item.La_outT[5]>0?'layui-input-green':''" style="width: 40px;">
                                                </div>
                                            </td>

                                            <td v-show="enTB && 1==1">
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.La_firstFeed"    name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input"  style="width: 40px;">
                                                </div>
                                            </td>

                                            <td v-show="enTB && 1==1">
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.La_ftbFeed"    name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input"  style="width: 40px;">
                                                </div>
                                            </td>

                                            <td v-show="enTB && 1==1">
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.La_tbFeed"    name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input"  style="width: 40px;">
                                                </div>
                                            </td>

                                            <td v-show="1==1">
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.La_wgapTime"    name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input"  style="width: 40px;">
                                                </div>
                                            </td>

                                            <td v-show="1==1">
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.La_cw"    name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input"  style="width: 40px;">
                                                </div>
                                            </td>

                                            <td v-show="!enTB && 1==1">
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.La_autoFeed"    name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input"  style="width: 40px;">
                                                </div>
                                            </td>

                                            <td v-show="!enTB && 1==1">
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.La_fgapTime"    name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input"  style="width: 40px;">
                                                </div>
                                            </td>

                                            <td v-show="enTB && is_admin">
                                                <div  class="layui-input-inline" style="width: 100%;">
                                                    <input type="checkbox" v-model="item.La_flag_bits[0]" style="width: 60px;" checked="" lay-skin="switch" lay-text="是|否" name="_La_flag_bit0">
                                                </div>
                                            </td>
                                            <td v-show="enTB && is_admin">
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="checkbox" v-model="item.La_flag_bits[1]" style="width: 60px;" checked="" lay-skin="switch" lay-text="是|否" name="_La_flag_bit1">
                                                </div>
                                            </td>
                                            <td v-show="enTB && is_admin">
                                                <div  class="layui-input-inline" style="width: 100%;">
                                                    <input type="checkbox" v-model="item.La_flag_bits[2]" style="width: 60px;" checked="" lay-skin="switch" lay-text="是|否" name="_La_flag_bit2">
                                                </div>
                                            </td>
                                            <td v-show="enTB && is_admin">
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="checkbox" v-model="item.La_flag_bits[3]" style="width: 60px;" checked="" lay-skin="switch" lay-text="是|否" name="_La_flag_bit3">
                                                </div>
                                            </td>
                                            <td v-show="enTB && is_admin">
                                                <div  class="layui-input-inline" style="width: 100%;">
                                                    <input type="checkbox" v-model="item.La_flag_bits[4]" style="width: 60px;" checked="" lay-skin="switch" lay-text="是|否" name="_La_flag_bit4">
                                                </div>
                                            </td>
                                            <td v-show="enTB && is_admin">
                                                <div  class="layui-input-inline" style="width: 100%;">
                                                    <input type="checkbox" v-model="item.La_flag_bits[5]" style="width: 60px;" checked="" lay-skin="switch" lay-text="是|否" name="_La_flag_bit5">
                                                </div>
                                            </td>

                                            <td >
                                                <!-- <span @click="onClearLine(item,idx);" class="layui-hide action-edit hand layui-text-sm layui-text-mute radius" ><i class="layui-icon close-btn layui-icon-close-fill layui-text-main-color mr-sm"></i></span> -->
                                                <span style="display: block; width: 60px;" @click="onClearLine(item,idx);" class=" text-center action-edit hand layui-text-sm layui-text-mute radius" ><i class="layui-icon close-btn layui-icon-fonts-clear layui-text-orange-light mr-sm"></i></span>
                                                
                                            </td>
                                        </tr>
                                    </template>
                                    
                                    
                                </tbody>
                            </table>
                        </div>
                        
                    </div>

                    <div v-show="mode==3" class="bg-panel mr-top-md" >
                        <div class="panel-header pd-md">
                            <span class="panel-title ">
                                <span class="layui-badge-dot layui-bg-olive"></span> 
                                <span class="layui-text-xs ">保育方案参数</span>

                                <button type="button" @click="onApplyDefault();" class="action-edit layui-hide  radius-10  mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class=" layui-icon close-btn layui-icon-release layui-text-white mr-sm"></i> 使用默认</button>
                                        <button type="button" @click="onClearAll();" class="action-edit radius-10  mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon close-btn layui-icon-close layui-text-white mr-sm"></i> 清空</button>
                                
                            </span>
                        </div>

                        <div class="mr-md" style="overflow: auto;">
                            <table class="layui-table" lay-size="sm" style="table-layout: fixed !important;width: auto !important;">
                                <colgroup>
                                    <col width="40">
                                    <col width="40">

                                    <col width="90">
                                    <col width="40">
                                    <col width="90">
                                    <col width="40">
                                    <col width="90">
                                    <col width="40">
                                    <col width="90">
                                    <col width="40">
                                    <col width="90">
                                    <col width="40">
                                    <col width="90">
                                    <col width="40">


                                    <col width="60">
                                    <col width="60">
                                    <col width="60">
                                    <col width="60">

                                    <col width="60">
                                    
                                </colgroup>
                                <thead>
                                    <tr>
                                        <th class="center" colspan="1" rowspan="3">日龄</th>
                                        <th class="center" colspan="1" rowspan="3">水料比</th>

                                        <th class="center" colspan="12" rowspan="1">时间段</th>

                                        <th class="center" colspan="1" rowspan="3">单次下料量(kg)</th>
                                        <!-- <th class="center" colspan="1" rowspan="3">自动出料时间保护(分)</th> -->
                                        <!-- <th class="center" colspan="1" rowspan="3">自动出水保护时间(分)</th> -->
                                        <th class="center" colspan="1" rowspan="3" >
                                            自动出料时间保护 单位:
                                            <select lay-ignore style="height: 15px;
                                                font-size: 11px;
                                                background-color: #ffffff;
                                                color: #000000;
                                                border: 0px;
                                                "  v-model="wp_unit"   >
                                                    <option  value="0">分</option>
                                                    <option  value="1">秒</option>
                                            </select>
                                        </th>
                                        <th class="center" colspan="1" rowspan="3" >
                                            自动出水保护时间 单位:
                                            <select lay-ignore style="height: 15px;
                                                font-size: 11px;
                                                background-color: #ffffff;
                                                color: #000000;
                                                border: 0px;
                                                "  v-model="wp_unit"   >
                                                    <option  value="0">分</option>
                                                    <option  value="1">秒</option>
                                            </select>
                                        </th>
                                        <th class="center" colspan="1" rowspan="3">单次补水量(L)</th>

                                        <th class="center" colspan="1" rowspan="3">重置</th>
                                    </tr>

                                    <tr>
                                        <th class="center" colspan="2" rowspan="1">第1餐</th>
                                        <th class="center" colspan="2" rowspan="1">第2餐</th>
                                        <th class="center" colspan="2" rowspan="1">第3餐</th>
                                        <th class="center" colspan="2" rowspan="1">第4餐</th>
                                        <th class="center" colspan="2" rowspan="1">第5餐</th>
                                        <th class="center" colspan="2" rowspan="1">第6餐</th>
                                    </tr>
                                    <tr>
                                        <th class="center">时间</th>
                                        <th class="center">诱食</th>

                                        <th class="center">时间</th>
                                        <th class="center">诱食</th>

                                        <th class="center">时间</th>
                                        <th class="center">诱食</th>

                                        <th class="center">时间</th>
                                        <th class="center">诱食</th>

                                        <th class="center">时间</th>
                                        <th class="center">诱食</th>

                                        <th class="center">时间</th>
                                        <th class="center">诱食</th>
                                    </tr>
                                    
                                </thead>
                                <tbody>
                                    <template  v-for="(item,idx) in Nr_para">
                                        <tr>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.Nr_gday" @input="on_Nr_gday(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input" style="width: 40px">
                                                </div>
                                            </td>

                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.Nr_waterFeed" @input="on_Nr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input" :class="item.Nr_waterFeed>0?'layui-input-green':''" style="width: 40px">
                                                </div>
                                            </td>

                                            <td>
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" :id="'Nr_time-'+idx+'-0'" :idx="idx" :idx1="0" v-model="item.Nr_time[0]" @input="on_Nr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input Nr_time" :class="item.Nr_time[0]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="checkbox" v-model="item.Nr_flag_bits[0]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Nr_flag_bits0">
                                                </div>
                                            </td>


                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" :id="'Nr_time-'+idx+'-1'" :idx="idx" :idx1="1" v-model="item.Nr_time[1]" v-model="item.Nr_time[1]" @input="on_Nr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input Nr_time" :class="item.Nr_time[1]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="checkbox" v-model="item.Nr_flag_bits[1]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Nr_flag_bits1">
                                                </div>
                                            </td>

                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" :id="'Nr_time-'+idx+'-2'" :idx="idx" :idx1="2"  v-model="item.Nr_time[2]" @input="on_Nr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input Nr_time" :class="item.Nr_time[2]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="checkbox" v-model="item.Nr_flag_bits[2]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Nr_flag_bits2">
                                                </div>
                                            </td>

                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" :id="'Nr_time-'+idx+'-3'" :idx="idx" :idx1="3" v-model="item.Nr_time[3]" @input="on_Nr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input Nr_time" :class="item.Nr_time[3]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="checkbox" v-model="item.Nr_flag_bits[3]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Nr_flag_bits3">
                                                </div>
                                            </td>

                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" :id="'Nr_time-'+idx+'-4'" :idx="idx" :idx1="4" v-model="item.Nr_time[4]" @input="on_Nr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input Nr_time" :class="item.Nr_time[4]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="checkbox" v-model="item.Nr_flag_bits[4]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Nr_flag_bits4">
                                                </div>
                                            </td>

                                            <td>
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" :id="'Nr_time-'+idx+'-5'" :idx="idx" :idx1="5" v-model="item.Nr_time[5]" @input="on_Nr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input Nr_time" :class="item.Nr_time[5]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px;">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="checkbox" v-model="item.Nr_flag_bits[5]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Nr_flag_bits5">
                                                </div>
                                            </td>

                                            <td>
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.Nr_autoFeed" @input="validate_0_0dot5_float(item,idx,event)"  name="Nr_autoFeed" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input"  style="width: 60px;">
                                                </div>
                                            </td>

                                            <td>
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.Nr_fgapTime" @input="on_Nr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input"  style="width: 60px;">
                                                </div>
                                            </td>

                                            <td>
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.Nr_wgapTime" @input="on_Nr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input"  style="width: 60px;">
                                                </div>
                                            </td>

                                            <td style="width: 60px;">
                                                <div class="layui-input-inline" >
                                                    <input type="text" v-model="item.Nr_cw" @input="on_Nr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input"  style="width: 60px;">
                                                </div>
                                            </td>

                                            

                                            <td >
                                                <!-- <span @click="onClearLine(item,idx);" class="layui-hide action-edit hand layui-text-sm layui-text-mute radius" ><i class="layui-icon close-btn layui-icon-close-fill layui-text-main-color mr-sm"></i></span> -->
                                                <span style="display: block; width: 60px;" @click="onClearLine(item,idx);" class="layui-hide text-center action-edit hand layui-text-sm layui-text-mute radius" ><i class="layui-icon close-btn layui-icon-fonts-clear layui-text-orange-light mr-sm"></i></span>
                                                
                                            </td>
                                        </tr>
                                    </template>
                                    
                                    
                                </tbody>
                            </table>
                        </div>

                        
                    </div>


                    <div v-show="mode==4 || (mode==3 && autoSwitchGrowthMode>0) " class="bg-panel mr-top-md" >
                        <div class="panel-header pd-md">
                            <span class="panel-title ">
                                <span class="layui-badge-dot layui-bg-olive"></span> 
                                <span class="layui-text-xs ">育肥方案参数</span>
                                
                                <button type="button" @click="onApplyDefault();" class="action-edit layui-hide  radius-10  mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class=" layui-icon close-btn layui-icon-release layui-text-white mr-sm"></i> 使用默认</button>
                                        <button type="button" @click="onClearAll();" class="action-edit radius-10  mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon close-btn layui-icon-close layui-text-white mr-sm"></i> 清空</button>
                            </span>
                        </div>

                        <div class="mr-md" style="overflow: auto;">
                            <table class="layui-table" lay-size="sm" style="table-layout: fixed !important;width: auto !important;">
                                <colgroup>
                                    <col width="40">
                                    <col width="40">

                                    <col width="90">
                                    <col width="40">
                                    <col width="90">
                                    <col width="40">
                                    <col width="90">
                                    <col width="40">
                                    <col width="90">
                                    <col width="40">
                                    <col width="90">
                                    <col width="40">
                                    <col width="90">
                                    <col width="40">


                                    <col width="60">
                                    <col width="60">
                                    <col width="60">
                                    <col width="60">

                                    <col width="60">
                                    
                                </colgroup>
                                <thead>
                                    <tr>
                                        <th class="center" colspan="1" rowspan="3">日龄</th>
                                        <th class="center" colspan="1" rowspan="3">水料比</th>

                                        <th class="center" colspan="12" rowspan="1">时间段</th>

                                        <th class="center" colspan="1" rowspan="3">单次下料量(kg)</th>
                                        <!-- <th class="center" colspan="1" rowspan="3">自动出料时间保护(分)</th> -->
                                        <!-- <th class="center" colspan="1" rowspan="3">自动出水保护时间(分)</th> -->
                                        <th class="center" colspan="1" rowspan="3" >
                                            自动出料时间保护 单位:
                                            <select lay-ignore style="height: 15px;
                                                font-size: 11px;
                                                background-color: #ffffff;
                                                color: #000000;
                                                border: 0px;
                                                "  v-model="wp_unit"   >
                                                    <option  value="0">分</option>
                                                    <option  value="1">秒</option>
                                            </select>
                                        </th>
                                        <th class="center" colspan="1" rowspan="3" >
                                            自动出水保护时间 单位:
                                            <select lay-ignore style="height: 15px;
                                                font-size: 11px;
                                                background-color: #ffffff;
                                                color: #000000;
                                                border: 0px;
                                                "  v-model="wp_unit"   >
                                                    <option  value="0">分</option>
                                                    <option  value="1">秒</option>
                                            </select>
                                        </th>
                                        <th class="center" colspan="1" rowspan="3">单次补水量(L)</th>

                                        <th class="center" colspan="1" rowspan="3">重置</th>
                                    </tr>

                                    <tr>
                                        <th class="center" colspan="2" rowspan="1">第1餐</th>
                                        <th class="center" colspan="2" rowspan="1">第2餐</th>
                                        <th class="center" colspan="2" rowspan="1">第3餐</th>
                                        <th class="center" colspan="2" rowspan="1">第4餐</th>
                                        <th class="center" colspan="2" rowspan="1">第5餐</th>
                                        <th class="center" colspan="2" rowspan="1">第6餐</th>
                                    </tr>
                                    <tr>
                                        <th class="center">时间</th>
                                        <th class="center">诱食</th>

                                        <th class="center">时间</th>
                                        <th class="center">诱食</th>

                                        <th class="center">时间</th>
                                        <th class="center">诱食</th>

                                        <th class="center">时间</th>
                                        <th class="center">诱食</th>

                                        <th class="center">时间</th>
                                        <th class="center">诱食</th>

                                        <th class="center">时间</th>
                                        <th class="center">诱食</th>
                                    </tr>
                                    
                                </thead>
                                <tbody>
                                    <template  v-for="(item,idx) in Fat_para">
                                        <tr>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.Fat_gday" @input="on_Fat_gday(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input" style="width: 40px">
                                                </div>
                                            </td>

                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.Fat_waterFeed" @input="on_Fat_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input" :class="item.Fat_waterFeed>0?'layui-input-green':''" style="width: 40px">
                                                </div>
                                            </td>

                                            <td>
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" :id="'Fat_time-'+idx+'-0'" :idx="idx" :idx1="0" v-model="item.Fat_time[0]" @input="on_Fat_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input Fat_time" :class="item.Fat_time[0]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="checkbox" v-model="item.Fat_flag_bits[0]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Fat_flag_bits0">
                                                </div>
                                            </td>


                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" :id="'Fat_time-'+idx+'-1'" :idx="idx" :idx1="1" v-model="item.Fat_time[1]" v-model="item.Fat_time[1]" @input="on_Fat_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input Fat_time" :class="item.Fat_time[1]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="checkbox" v-model="item.Fat_flag_bits[1]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Fat_flag_bits1">
                                                </div>
                                            </td>

                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" :id="'Fat_time-'+idx+'-2'" :idx="idx" :idx1="2"  v-model="item.Fat_time[2]" @input="on_Fat_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input Fat_time" :class="item.Fat_time[2]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="checkbox" v-model="item.Fat_flag_bits[2]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Fat_flag_bits2">
                                                </div>
                                            </td>

                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" :id="'Fat_time-'+idx+'-3'" :idx="idx" :idx1="3" v-model="item.Fat_time[3]" @input="on_Fat_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input Fat_time" :class="item.Fat_time[3]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="checkbox" v-model="item.Fat_flag_bits[3]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Fat_flag_bits3">
                                                </div>
                                            </td>

                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" :id="'Fat_time-'+idx+'-4'" :idx="idx" :idx1="4" v-model="item.Fat_time[4]" @input="on_Fat_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input Fat_time" :class="item.Fat_time[4]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="checkbox" v-model="item.Fat_flag_bits[4]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Fat_flag_bits4">
                                                </div>
                                            </td>

                                            <td>
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" :id="'Fat_time-'+idx+'-5'" :idx="idx" :idx1="5" v-model="item.Fat_time[5]" @input="on_Fat_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input Fat_time" :class="item.Fat_time[5]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px;">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="checkbox" v-model="item.Fat_flag_bits[5]" style="width: 40px;" checked="" lay-skin="switch" lay-text="是|否" name="_Fat_flag_bits5">
                                                </div>
                                            </td>

                                            <td>
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.Fat_autoFeed" @input="validate_0_0dot5_float(item,idx,event)"  name="Fat_autoFeed"  lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input"  style="width: 60px;">
                                                </div>
                                            </td>

                                            <td>
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.Fat_fgapTime" @input="on_Fat_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input"  style="width: 60px;">
                                                </div>
                                            </td>

                                            <td>
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="item.Fat_wgapTime" @input="on_Fat_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input"  style="width: 60px;">
                                                </div>
                                            </td>

                                            <td style="width: 60px;">
                                                <div class="layui-input-inline" >
                                                    <input type="text" v-model="item.Fat_cw" @input="on_Fat_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input"  style="width: 60px;">
                                                </div>
                                            </td>

                                            

                                            <td >
                                                <!-- <span @click="onClearLine(item,idx);" class="layui-hide action-edit hand layui-text-sm layui-text-mute radius" ><i class="layui-icon close-btn layui-icon-close-fill layui-text-main-color mr-sm"></i></span> -->
                                                <span style="display: block; width: 60px;" @click="onClearLine(item,idx);" class="layui-hide text-center action-edit hand layui-text-sm layui-text-mute radius" ><i class="layui-icon close-btn layui-icon-fonts-clear layui-text-orange-light mr-sm"></i></span>
                                                
                                            </td>
                                        </tr>
                                    </template>
                                    
                                    
                                </tbody>
                            </table>
                        </div>
                        
                    </div>


                    <div v-show="mode==5" class="bg-panel mr-top-md">
                        <div class="panel-header pd-md">
                            <span class="panel-title ">
                                <span class="layui-badge-dot layui-bg-olive"></span> 
                                <span class="layui-text-xs ">定时方案参数</span>

                                <button type="button" @click="onApplyDefault();" class="action-edit layui-hide  radius-10  mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class=" layui-icon close-btn layui-icon-release layui-text-white mr-sm"></i> 使用默认</button>
                                        <button type="button" @click="onClearAll();" class="action-edit radius-10  mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon close-btn layui-icon-close layui-text-white mr-sm"></i> 清空</button>
                                
                            </span>
                        </div>

                        <div class="mr-md" style="overflow: auto;">
                            <table class="layui-table" lay-size="sm" style="table-layout: fixed !important;width: auto !important;">
                                <colgroup>
                                    <col width="40">
                                    <col width="40">
                                    <col width="40">

                                    <col width="90">
                                    <col width="40">
                                    <col width="90">
                                    <col width="40">
                                    <col width="90">
                                    <col width="40">
                                    <col width="90">
                                    <col width="40">
                                    <col width="90">
                                    <col width="40">
                                    <col width="90">
                                    <col width="40">

                                    <col width="60">
                                    <col width="60" v-show="Tmr_para.Tmr_flag_bits && Tmr_para.Tmr_flag_bits[0]">
                                    <col width="60" v-show="Tmr_para.Tmr_flag_bits && Tmr_para.Tmr_flag_bits[0]">
                                    <col width="60">
                                </colgroup>
                                <thead>
                                    <tr>
                                        <th class="center" colspan="1" rowspan="3">日总料量</th>
                                        <th class="center" colspan="1" rowspan="3">水料比</th>
                                        <th class="center" colspan="1" rowspan="3">餐数</th>

                                        <th class="center" colspan="12" rowspan="1">每餐下料(下料单位kg)</th>

                                        <th class="center" colspan="1" rowspan="3">补水</th>
                                        <!-- <th class="center" colspan="1" rowspan="3" v-show="Tmr_para.Tmr_flag_bits && Tmr_para.Tmr_flag_bits[0]">自动出水保护时间(分)</th> -->
                                        <th class="center" colspan="1" rowspan="3" v-show="Tmr_para.Tmr_flag_bits && Tmr_para.Tmr_flag_bits[0]">
                                            自动出水保护时间 单位:
                                            <select lay-ignore style="height: 15px;
                                                font-size: 11px;
                                                background-color: #ffffff;
                                                color: #000000;
                                                border: 0px;
                                                "  v-model="wp_unit"   >
                                                    <option  value="0">分</option>
                                                    <option  value="1">秒</option>
                                            </select>
                                        </th>
                                        <th class="center" colspan="1" rowspan="3" v-show="Tmr_para.Tmr_flag_bits && Tmr_para.Tmr_flag_bits[0]">单次补水量(L)</th>
                                        
                                        <th class="center" colspan="1" rowspan="3">重置</th>
                                        
                                        <!-- <th><span @click="" class="layui-hide  fr hand layui-text-sm layui-text-mute radius" style="margin-right: 5px;"><i class="layui-icon close-btn layui-icon-add-circle layui-text-main-color mr-sm" style="font-size: 18px;"></i></span></th> -->
                                    </tr>

                                    <tr>
                                        <th class="center" colspan="2" rowspan="1">第1餐</th>
                                        <th class="center" colspan="2" rowspan="1">第2餐</th>
                                        <th class="center" colspan="2" rowspan="1">第3餐</th>
                                        <th class="center" colspan="2" rowspan="1">第4餐</th>
                                        <th class="center" colspan="2" rowspan="1">第5餐</th>
                                        <th class="center" colspan="2" rowspan="1">第6餐</th>
                                    </tr>

                                    <tr>
                                        <th class="center">时间</th>
                                        <th class="center">下料</th>

                                        <th class="center">时间</th>
                                        <th class="center">下料</th>

                                        <th class="center">时间</th>
                                        <th class="center">下料</th>

                                        <th class="center">时间</th>
                                        <th class="center">下料</th>

                                        <th class="center">时间</th>
                                        <th class="center">下料</th>

                                        <th class="center">时间</th>
                                        <th class="center">下料</th>

                                        
                                    <tr>

                                    
                                </thead>
                                <tbody>
                                    <template  v-if="Tmr_para.Tmr_time">
                                        <tr>
                                        
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="Tmr_para.Tmr_total_feed" readonly name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input" :class="Tmr_para.Tmr_total_feed>0?'layui-input-green':''" style="width: 40px">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="Tmr_para.Tmr_waterFeed" @input="on_Tmr_waterFeed(item)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input" :class="Tmr_para.Tmr_waterFeed>0?'layui-input-green':''" style="width: 40px">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="Tmr_para.Tmr_feed_num" readonly name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input" :class="Tmr_para.Tmr_feed_num>0?'layui-input-green':''" style="width: 40px">
                                                </div>
                                            </td>

                                            <td>
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text"  :idx="0"  v-model="Tmr_para.Tmr_time[0]" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input Tmr_time" :class="Tmr_para.Tmr_time[0]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="Tmr_para.Tmr_outT[0]" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input" :class="Tmr_para.Tmr_outT[0]>0?'layui-input-green':''" style="width: 40px">
                                                </div>
                                            </td>


                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" :idx="1" v-model="Tmr_para.Tmr_time[1]" v-model="Tmr_para.Tmr_time[1]" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input Tmr_time" :class="Tmr_para.Tmr_time[1]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="Tmr_para.Tmr_outT[1]" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input" :class="Tmr_para.Tmr_outT[1]>0?'layui-input-green':''" style="width: 40px">
                                                </div>
                                            </td>

                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" :idx="2"  v-model="Tmr_para.Tmr_time[2]" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input Tmr_time" :class="Tmr_para.Tmr_time[2]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="Tmr_para.Tmr_outT[2]" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input" :class="Tmr_para.Tmr_outT[2]>0?'layui-input-green':''" style="width: 40px">
                                                </div>
                                            </td>

                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" :idx="3" v-model="Tmr_para.Tmr_time[3]" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input Tmr_time" :class="Tmr_para.Tmr_time[3]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="Tmr_para.Tmr_outT[3]" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input" :class="Tmr_para.Tmr_outT[3]>0?'layui-input-green':''" style="width: 40px">
                                                </div>
                                            </td>

                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" :idx="4" v-model="Tmr_para.Tmr_time[4]" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input Tmr_time" :class="Tmr_para.Tmr_time[4]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px">
                                                </div>
                                            </td>
                                            <td >
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="Tmr_para.Tmr_outT[4]" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input" :class="Tmr_para.Tmr_outT[4]>0?'layui-input-green':''" style="width: 40px">
                                                </div>
                                            </td>

                                            <td>
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" :idx="5" v-model="Tmr_para.Tmr_time[5]" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input Tmr_time" :class="Tmr_para.Tmr_time[5]!='00:00 - 00:00'?'layui-input-green':''" style="width: 90px;">
                                                </div>
                                            </td>
                                            <td>
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="Tmr_para.Tmr_outT[5]" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input" :class="Tmr_para.Tmr_outT[5]>0?'layui-input-green':''" style="width: 40px;">
                                                </div>
                                            </td>

                                            <td>
                                                <div  class="layui-input-inline" style="width: 100%;">
                                                    <input type="checkbox" v-model="Tmr_para.Tmr_flag_bits[0]" style="width: 60px;" checked="" lay-skin="switch" lay-text="是|否" name="_Tmr_flag_bits0">
                                                </div>
                                            </td>

                                            <td v-show="Tmr_para.Tmr_flag_bits && Tmr_para.Tmr_flag_bits[0]">
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="Tmr_para.Tmr_wgapTime" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input"  style="width: 60px;">
                                                </div>
                                            </td>

                                            <td v-show="Tmr_para.Tmr_flag_bits && Tmr_para.Tmr_flag_bits[0]">
                                                <div class="layui-input-inline" style="width: 100%;">
                                                    <input type="text" v-model="Tmr_para.Tmr_cw" @input="on_Tmr_waterFeed(item,idx)"   name="" lay-verify="" lay-verType="tips" placeholder="" autocomplete="off"
                                                        class="layui-input"  style="width: 60px;">
                                                </div>
                                            </td>

                                            

                                            <td >
                                                <span style="display: block; width: 60px;" @click="onClearLine();" class="layui-hide text-center action-edit hand layui-text-sm layui-text-mute radius" ><i class="layui-icon close-btn layui-icon-fonts-clear layui-text-orange-light mr-sm"></i></span>
                                                <!-- <button type="button" @click="onClearAll();" class="action-edit radius-10 fr mr-sm layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon close-btn layui-icon-close layui-text-white mr-sm"></i> 清空</button> -->
                                                
                                            </td>
                                        </tr>
                                    </template>
                                    
                                </tbody>
                            </table>
                        </div>
                        
                    </div>

                </div>
                
            </div>
            <div style="height: 50px;">
                <button type="button" id="maxbtn" onclick="onMaxSize();" style="display: none;" class="radius-10 fr mr-lg layui-btn layui-btn-sm layui-btn-primary"><i class="layui-icon close-btn layui-icon-screen-full layui-text-white mr-sm"></i> 全屏</button>
                <button type="button" onclick="onSave();" class="action-edit radius-10 fr mr-lg layui-btn layui-btn-sm layui-btn-primary"><i class="layui-icon close-btn layui-icon-release layui-text-white mr-sm"></i> 保存方案</button>
            </div>
        </div>
    </div>
<script src="../js/check_screen.js?v=${.Config.basic.version}"></script>

</body>

<script src="../plugins/layui/layui.js"></script>
<script src="../plugins/vue/vue.min.js"></script>
<script src="../plugins/layui/xm-select-v1.2.4.js"></script>
<script src="../plugins/jquery/jquery-3.6.0.js?v=${.Config.basic.version}"></script>
<script src="../plugins/zTree/js/jquery.ztree.core.min.js?v=${.Config.basic.version}"></script>
<script src="../plugins/zTree/js/jquery.ztree.excheck.js"></script>
<script src="../plugins/zTree/js/jquery.ztree.exedit.js"></script>
<script src="../plugins/jquery.slimscroll.min.js"></script>
<script src="../plugins/toastr/toastr.min.js"></script>
<script src="../js/utils.js"></script>
<script src="../js/func.js?v=${.Config.basic.version}"></script>
<script src="../js/verify.js"></script>
<script>

    var no_display_zero = true;//是否把0显示为空
    var zTree=null;
    var table=null;
    var form=null;
    var Table=null;
    var lay_index=null;
    var curAddr=null;
    var laydate = null;

    var user_info=JSON.parse(window.localStorage.getItem("user_info"));
    var is_admin = user_info.is_admin;
    if(user_info.role_ids=="service"){
        is_admin = true;
    }
    var is_admin = true;
    var func_url="${.func_url}";
    var actions=[];
    var token = window.localStorage.getItem("token");
    token = 'Bearer ' + token;



    var request = getRequest();
    console.info(request);

    var nodePara=null;

    var vm = new Vue({
        el: '.node_para',
        data: {
            name:'',
            remark:'',
            is_admin:is_admin,
            mode:0,//模式
            enTB:0,//是否启用触碰杆
            autoSwitchGrowthMode:0,
            wp_unit:-1,//保护时间单位
            node_para:{},
            Pg_para:[],
            La_para:[],
            Nr_para:[],
            Fat_para:[],
            Tmr_para:[]
        },
        computed:function(){
            console.info("computed")
        },
        updated:function(){
            console.info("updated")
            if(laydate){
                lay('.Pg_time').each(function(){ 
                    laydate.render({
                        elem: this
                        ,type: 'time'
                        ,range: '-'
                        , theme: '#3c7cff'
                        ,format: 'HH:mm'
                        ,trigger: 'click'
                        ,done: function(value, date, endDate){
                            console.info(date);
                            console.info(this);
                            //value=value.replace(/\s+/g,"");//去空格
                            var idx = parseInt($(this.elem[0]).attr("idx"));
                            var idx1 = parseInt($(this.elem[0]).attr("idx1"));
                            console.info(idx,idx1,value);
                            var str = value.trim(" ").replace(/:/g,"");
                            var arr = str.split("-");
                            var begin =parseInt(arr[0]);
                            var end =parseInt(arr[1]);
                            //console.info(str,arr,begin,end);
                            if(begin>=end){
                                toastr.warning("开始时间不能大于等于结束时间", "提示");
                                value="00:00 - 00:00"
                            }
                            else if(end-begin<3){
                                toastr.warning("时间间隔必须大于2分钟", "提示");
                                value="00:00 - 00:00"
                            }
                            if(no_display_zero){
                                if(value=="00:00 - 00:00"){
                                    value="";
                                }
                            }
                            
                            vm.Pg_para[idx].Pg_time[idx1] = value;
                            var Pg_feed_num = 0;
                            var Pg_total_feed = 0;
                            
                            for(var x=0;x<vm.Pg_para[idx].Pg_time.length;x++){
                                //console.info("vm.Pg_para[idx].Pg_time[x]=",vm.Pg_para[idx].Pg_time[x])
                                if(vm.Pg_para[idx].Pg_time[x]!=""){
                                    Pg_feed_num++;
                                    console.info("vm.Pg_para[idx].Pg_outT[x]=",vm.Pg_para[idx].Pg_outT[x])
                                    var out = 0;
                                    if((vm.Pg_para[idx].Pg_outT[x])!="" && !isNaN(vm.Pg_para[idx].Pg_outT[x])){
                                        out =parseFloat(vm.Pg_para[idx].Pg_outT[x]);
                                    }else{
                                        out = 0;
                                    }
                                    console.info("out=",out)
                                    Pg_total_feed+=out;
                                }else{
                                    console.info("vm.Pg_para[idx].Pg_time[x] is empty")
                                }
                            }

                            vm.Pg_para[idx].Pg_feed_num = Pg_feed_num;
                            vm.Pg_para[idx].Pg_total_feed = parseFloat(Pg_total_feed.toFixed(1));
                            vm.$forceUpdate();
                        }
                        ,ready: formatminutes
                    });
                });
                lay('.La_time').each(function(){ 
                    laydate.render({
                        elem: this
                        ,type: 'time'
                        ,range: '-'
                        , theme: '#3c7cff'
                        ,format: 'HH:mm'
                        ,trigger: 'click'
                        ,done: function(value, date, endDate){
                            console.info(date);
                            console.info(this);
                            //value=value.replace(/\s+/g,"");//去空格
                            var idx = parseInt($(this.elem[0]).attr("idx"));
                            var idx1 = parseInt($(this.elem[0]).attr("idx1"));
                            console.info(idx,idx1,value);
                            var str = value.trim(" ").replace(/:/g,"");
                            var arr = str.split("-");
                            var begin =parseInt(arr[0]);
                            var end =parseInt(arr[1]);
                            //console.info(str,arr,begin,end);
                            if(begin>=end){
                                toastr.warning("开始时间不能大于等于结束时间", "提示");
                                value="00:00 - 00:00"
                            }
                            else if(end-begin<3){
                                toastr.warning("时间间隔必须大于2分钟", "提示");
                                value="00:00 - 00:00"
                            }
                            if(no_display_zero){
                                if(value=="00:00 - 00:00"){
                                    value="";
                                }
                            }
                            vm.La_para[idx].La_time[idx1] = value;
                            var La_feed_num = 0;
                            var La_total_feed = 0;
                            
                            for(var x=0;x<vm.La_para[idx].La_time.length;x++){
                                if(vm.La_para[idx].La_time[x]!=""){
                                    La_feed_num++;
                                    var out = 0;
                                    if((vm.La_para[idx].La_outT[x])!="" && !isNaN(vm.La_para[idx].La_outT[x])){
                                        out =parseFloat(vm.La_para[idx].La_outT[x]);
                                    }else{
                                         out = 0;
                                    }
                                    La_total_feed+=out;
                                }
                            }

                            vm.La_para[idx].La_feed_num = La_feed_num;
                            vm.La_para[idx].La_total_feed = parseFloat(La_total_feed.toFixed(1));
                            vm.$forceUpdate();
                        }
                        ,ready: formatminutes
                    });
                });

                lay('.Nr_time').each(function(){ 
                    laydate.render({
                        elem: this
                        ,type: 'time'
                        ,range: '-'
                        , theme: '#3c7cff'
                        ,format: 'HH:mm'
                        ,trigger: 'click'
                        ,done: function(value, date, endDate){
                            console.info(date);
                            console.info(this);
                            //value=value.replace(/\s+/g,"");//去空格
                            var idx = parseInt($(this.elem[0]).attr("idx"));
                            var idx1 = parseInt($(this.elem[0]).attr("idx1"));
                            console.info(idx,idx1,value);
                            var str = value.trim(" ").replace(/:/g,"");
                            var arr = str.split("-");
                            var begin =parseInt(arr[0]);
                            var end =parseInt(arr[1]);
                            //console.info(str,arr,begin,end);
                            if(begin>=end){
                                toastr.warning("开始时间不能大于等于结束时间", "提示");
                                value="00:00 - 00:00"
                            }
                            else if(end-begin<3){
                                toastr.warning("时间间隔必须大于2分钟", "提示");
                                value="00:00 - 00:00"
                            }
                            if(no_display_zero){
                                if(value=="00:00 - 00:00"){
                                    value="";
                                }
                            }
                            vm.Nr_para[idx].Nr_time[idx1] = value;
                            vm.$forceUpdate();
                        }
                        ,ready: formatminutes
                    });
                });


                lay('.Fat_time').each(function(){ 
                    laydate.render({
                        elem: this
                        ,type: 'time'
                        ,range: '-'
                        , theme: '#3c7cff'
                        ,format: 'HH:mm'
                        ,trigger: 'click'
                        ,done: function(value, date, endDate){
                            console.info(date);
                            console.info(this);
                            //value=value.replace(/\s+/g,"");//去空格
                            var idx = parseInt($(this.elem[0]).attr("idx"));
                            var idx1 = parseInt($(this.elem[0]).attr("idx1"));
                            console.info(idx,idx1,value);
                            var str = value.trim(" ").replace(/:/g,"");
                            var arr = str.split("-");
                            var begin =parseInt(arr[0]);
                            var end =parseInt(arr[1]);
                            //console.info(str,arr,begin,end);
                            if(begin>=end){
                                toastr.warning("开始时间不能大于等于结束时间", "提示");
                                value="00:00 - 00:00"
                            }
                            else if(end-begin<3){
                                toastr.warning("时间间隔必须大于2分钟", "提示");
                                value="00:00 - 00:00"
                            }
                            if(no_display_zero){
                                if(value=="00:00 - 00:00"){
                                    value="";
                                }
                            }
                            vm.Fat_para[idx].Fat_time[idx1] = value;
                            vm.$forceUpdate();
                        }
                        ,ready: formatminutes
                    });
                });

                lay('.Tmr_time').each(function(){ 
                    laydate.render({
                        elem: this
                        ,type: 'time'
                        ,range: '-'
                        , theme: '#3c7cff'
                        ,format: 'HH:mm'
                        ,trigger: 'click'
                        ,done: function(value, date, endDate){
                            console.info(date);
                            console.info(this);
                            //value=value.replace(/\s+/g,"");//去空格
                            var idx = parseInt($(this.elem[0]).attr("idx"));
                            console.info(idx,value);
                            var str = value.trim(" ").replace(/:/g,"");
                            var arr = str.split("-");
                            var begin =parseInt(arr[0]);
                            var end =parseInt(arr[1]);
                            //console.info(str,arr,begin,end);
                            if(begin>=end){
                                toastr.warning("开始时间不能大于等于结束时间", "提示");
                                value="00:00 - 00:00"
                            }
                            else if(end-begin<3){
                                toastr.warning("时间间隔必须大于2分钟", "提示");
                                value="00:00 - 00:00"
                            }
                            if(no_display_zero){
                                if(value=="00:00 - 00:00"){
                                    value="";
                                }
                            }
                            vm.Tmr_para.Tmr_time[idx] = value;
                            vm.$forceUpdate();
                        }
                        ,ready: formatminutes
                    });
                });

                form.render(); //更新全部
            }
        },
        watch: {
            // 当message变化时，这个函数就会被调用
            wp_unit: function (newValue, oldValue) {
                if(newValue!=oldValue && oldValue!=-1){
                    console.info("wp_unit change:",oldValue,newValue);
                    console.info("vm.wp_unit="+vm.wp_unit);
                    if(vm.wp_unit==0){
                        //切换为分钟
                        changePUnitMinute();
                    }
                    else{
                        //切换为秒
                        changePUnitSeconds();
                    }
                }
                
            }
        }
    });

    var selectedTreeNode=null;

    layui.config({
        base: '../layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index','layer','form', 'table','transfer','laydate','util'],function(){
        form = layui.form;
        table = layui.table;
        transfer = layui.transfer;
        laydate = layui.laydate;
        var util = layui.util;

        toastr.options = {
            "closeButton": false, //是否显示关闭按钮
            "debug": false, //是否使用debug模式
            "positionClass": "toast-top-center",//弹出窗的位置
            "showDuration": "300",//显示的动画时间
            "hideDuration": "1000",//消失的动画时间
            "timeOut": "2000", //展现时间
            "extendedTimeOut": "1000",//加长展示时间
            "showEasing": "swing",//显示时的动画缓冲方式
            "hideEasing": "linear",//消失时的动画缓冲方式
            "showMethod": "fadeIn",//显示时的动画方式
            "hideMethod": "fadeOut" //消失时的动画方式
        };

        $("#btnResetNode").hide();
        $(".node_para").show();

        $.ajax({
            type: 'GET',
            url: '../Api/User/Actions',
            data: {func_url:func_url},
            beforeSend: function(request) {
                request.setRequestHeader("Authorization", 'Bearer '+window.localStorage.getItem("token"));
            },
            dataType: "json",
            success: function (data) {
                //console.info(data)
                actions=data.data;
                checkPermission();
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                layer.msg('加载操作信息失败');
            }
        });

        form.on('select(group_code)', function(data){
            var group_code=data.value;
            console.info("group_code",group_code);
            renderFarmSelect(group_code);
        });

        renderGroupSelect();
        renderFarmSelect();
        

        form.on('select(Mode)', function(data){
            var Mode=data.value;
            console.info("Mode",Mode);
            vm.mode = Mode;
            vm.node_para.Mode = Mode;
            //loadHouse(cur_farm_id,id);
            resize();
        });
        form.on('switch(_EnTB)', function(data){
            console.log(data.elem.checked); //开关是否开启，true或者false
            vm.enTB = data.elem.checked?1:0;
        });
        form.on('switch(_EnAutoSwitchGrowthMode)', function(data){
            console.log(data.elem.checked); //开关是否开启，true或者false
            vm.autoSwitchGrowthMode = data.elem.checked?1:0;
        });  

        if(request.id){
            //修改方案
            loadPara(request);
        }else{
            //新增方案
            onApplyDefault();
        }

        if(request.max && request.max>0){
            $("#maxbtn").hide();
        }else{
            $("#maxbtn").show();
        }
        
    });

    function renderGroupSelect(){
        $.ajax({
            type: 'GET',
            url: '../Api/Group',
            data: {},
            beforeSend: function(request) {
                request.setRequestHeader("Authorization", 'Bearer '+window.localStorage.getItem("token"));
            },
            dataType: "json",
            success: function (res) {
                console.info(res)
                if(res.code>=0){
                    var items = res.data;
                    console.info(items)
                    //栏舍下拉
                    var html="<option value='' >请选择集团</option>";
                    for(var i=0;i<items.length;i++){
                        var selectd="";
                        html+="<option "+selectd+" value=\""+items[i].group_code+"\">"+items[i].group_name+"</option>";
                    }
                    $("select[name='group_code']").html(html);
                    form.render('select');
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                layer.msg('加载集团失败');
            }
        });
    }


    function renderFarmSelect(group_code){
        $.ajax({
            type: 'GET',
            url: '../Api/Farm/List',
            data: {},
            beforeSend: function(request) {
                request.setRequestHeader("Authorization", 'Bearer '+window.localStorage.getItem("token"));
            },
            dataType: "json",
            success: function (res) {
                console.info(res)
                if(res.code>=0){
                    var items = res.data;
                    console.info(items)
                    //栏舍下拉
                    var html="<option value='' >请选择场区</option>";
                    for(var i=0;i<items.length;i++){
                        var selectd="";
                        if(group_code){
                            if(items[i].group_code==group_code){
                                html+="<option "+selectd+" value=\""+items[i].id+"\">"+items[i].farmname+"</option>";
                            }
                        }
                        else{
                            html+="<option "+selectd+" value=\""+items[i].id+"\">"+items[i].farmname+"</option>";
                        }
                        
                        
                    }
                    $("select[name='farmid']").html(html);
                    form.render('select');
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                layer.msg('加载集团失败');
            }
        });
    }

    function checkPermission(){
        for(var i=0;i<actions.length;i++){
            $('.action-'+actions[i].action_id).removeClass("layui-hide");
        }
    }

    function loadPara(item) {
        layer.load(1);
        $.ajax({
            type: 'get',
            url: '../Api/FeedPlanNew',
            data: {id:item.id},
            beforeSend: function(request) {
                request.setRequestHeader("Authorization", 'Bearer '+window.localStorage.getItem("token"));
            },
            dataType: "json",
            success: function (res) {
                if(res.code>=0){
                    list = res.data;
                    //console.info(list);
                    if(list.length>0){
                        var plan = list[0];
                        nodePara =JSON.parse(plan.para);
                        //兼容26版本
                        if(!nodePara.WaterDelay){
                            nodePara.WaterDelay = nodePara.ReverseTimes;
                        }
                        if(!nodePara.PtTimeDelay){
                            nodePara.PtTimeDelay = nodePara.ReverseTurns;
                        }
                        if(!nodePara.CurIdle){
                            nodePara.CurIdle = nodePara.TbPTime[0];
                        }

                        var nodeEn = 1;
                        vm.name = plan.name;
                        vm.remark = plan.remark;
                        form.val("form_plan",plan);
                        disPlayNode(nodePara,nodeEn);
                    }
                    
                }else{

                    layer.alert(res.msg);
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                layer.msg('读取设备参数失败');
            },
            complete: function(XMLHttpRequest, textStatus) {
                layer.closeAll('loading');
            },
        });
        
        
    }

    function validate_0_0dot5_float(obj,idx,event){
        console.info("validate_0_0dot5_float",JSON.stringify(obj));
        console.info("validate_0_0dot5_float",idx);
        console.info("validate_0_0dot5_float",event);
        var val = event.target.value;
        var name = event.target.name;
        if (parseFloat(val) < 0 || parseFloat(val) > 0.5) {
            toastr.error("必须在0-0.5范围");
            val = val.substring(0, val.length - 1);
            $(event.target).css("background","#884311");
        }else{
            $(event.target).css("background","#ffffff");
        }
        
        setTimeout(()=>{obj[name] = val;},50)
    }

    function validate_int(min,max,event){
        console.info(event);
        var val = event.target.value;
        var name = event.target.name;
        if (parseFloat(val) < min || parseFloat(val) > max) {
            toastr.error("必须在"+min+"-"+max+"范围");
            val = val.substring(0, val.length - 1);
            $(event.target).css("background","#884311");
            
            setTimeout(()=>{$(event.target).val(val);},50)
        }else{
            $(event.target).css("background","#ffffff");
        }
    }
    
    function onPg_outT(idx,idx1,event){
        var Pg_feed_num = 0;
        var Pg_total_feed = 0;
        for(var x=0;x<vm.Pg_para[idx].Pg_time.length;x++){
            if(vm.Pg_para[idx].Pg_time[x]!=""){
                Pg_feed_num++;
                if(vm.Pg_para[idx].Pg_outT[x]==""){
                    vm.Pg_para[idx].Pg_outT[x] = 0;
                }
                Pg_total_feed+=parseFloat(vm.Pg_para[idx].Pg_outT[x]);
            }
        }
        vm.Pg_para[idx].Pg_feed_num = Pg_feed_num;
        vm.Pg_para[idx].Pg_total_feed = parseFloat(Pg_total_feed.toFixed(1));
        vm.$forceUpdate();
    }

    function onLa_outT(idx,idx1,event){
        var La_feed_num = 0;
        var La_total_feed = 0;
        for(var x=0;x<vm.La_para[idx].La_time.length;x++){
            if(vm.La_para[idx].La_time[x]!=""){
                La_feed_num++;
                if(vm.La_para[idx].La_outT[x]==""){
                    vm.La_para[idx].La_outT[x] = 0;
                }
                La_total_feed+=parseFloat(vm.La_para[idx].La_outT[x]);
            }
        }
        vm.La_para[idx].La_feed_num = La_feed_num;
        vm.La_para[idx].La_total_feed = parseFloat(La_total_feed.toFixed(1));
        vm.$forceUpdate();
    }

    function onTmr_outT(idx,event){
        console.info(idx,JSON.stringify(event));
        console.info(JSON.stringify(vm.Tmr_para));
        var Tmr_feed_num = 0;
        var Tmr_total_feed = 0;
        for(var x=0;x<vm.Tmr_para.Tmr_time.length;x++){
            if(vm.Tmr_para.Tmr_time[x]!=""){
                Tmr_feed_num++;
                if(vm.Tmr_para.Tmr_outT[x]==""){
                    vm.Tmr_para.Tmr_outT[x] = 0;
                }
                Tmr_total_feed+=parseFloat(vm.Tmr_para.Tmr_outT[x]);
            }
        }
        vm.Tmr_para.Tmr_feed_num = Tmr_feed_num;
        vm.Tmr_para.Tmr_total_feed = parseFloat(Tmr_total_feed.toFixed(1));
        vm.$forceUpdate();
    }

    function disPlayNode(nodePara,nodeEn) {
        console.info(JSON.stringify(nodePara));
        var form_node_param = {};
        form_node_param["_EnWater"] = nodePara.EnWater>0?"on":"";
        form_node_param["_EnTB"] = nodePara.EnTB>0?"on":"";
        form_node_param["_Enable"] = nodeEn>0?"on":"";
        form_node_param["Mode"] = nodePara.Mode;
        if(nodePara.Tmr_flag_bits[1]){
            form_node_param["_EnAutoSwitchGrowthMode"] = "on";
            vm.autoSwitchGrowthMode = 1;
        }else{
            form_node_param["_EnAutoSwitchGrowthMode"] = "";
            vm.autoSwitchGrowthMode = 0;
        }
        if(nodePara.Tmr_flag_bits[2]){
            form_node_param["_EnFirstTouchAsFirstFeed"] = "on";
        }else{
            form_node_param["_EnFirstTouchAsFirstFeed"] = "";
        }
        if(nodePara.Tmr_flag_bits[3]){
            form_node_param["_EnMotorCurProtect"] = "";
        }else{
            form_node_param["_EnMotorCurProtect"] = "on";
        }
        if(nodePara.Tmr_flag_bits[4]){
            form_node_param["_EnMotorCurIdle"] = "on";
        }else{
            form_node_param["_EnMotorCurIdle"] = "";
        }
        if(nodePara.Tmr_flag_bits[5]){
            vm.wp_unit = "1";
        }else{
            vm.wp_unit = "0";
        }
        console.info(form_node_param);
        form.val("form_node_param",form_node_param);

        //模式
        vm.mode = nodePara.Mode;
        vm.enTB = nodePara.EnTB;
        //妊娠
        vm.Pg_para = [];
        //兼容之前方案
        if(nodePara.Pg_rev_bits){
        }else{
            nodePara.Pg_rev_bits = [[false,false,false,false,false,false,false,false],[false,false,false,false,false,false,false,false],[false,false,false,false,false,false,false,false],[false,false,false,false,false,false,false,false],[false,false,false,false,false,false,false,false],[false,false,false,false,false,false,false,false]];
        }
        
        for(var i=0;i<nodePara.Pg_gday.length;i++)
        {
            //计算当日总料量
            var Pg_feed_num = 0;
            var Pg_total_feed = 0;
            var Pg_time = [];
            
            for(var x=0;x<nodePara.Pg_startT[i].length;x++){
                

                if(nodePara.Pg_startT[i][x]!="00:00" || nodePara.Pg_endT[i][x]!="00:00"){
                    Pg_time.push(nodePara.Pg_startT[i][x]+" - "+nodePara.Pg_endT[i][x]);
                    if(nodePara.Pg_outT[i][x]=="" || isNaN(nodePara.Pg_outT[i][x])){
                        Pg_total_feed += 0;
                    }else{
                        Pg_total_feed += parseFloat(nodePara.Pg_outT[i][x]);

                    }
                    //Pg_total_feed += parseFloat(nodePara.Pg_outT[i][x]);
                    Pg_feed_num+=1;
                }else{
                    if(no_display_zero){
                        Pg_time.push("");
                    }
                    else{
                        Pg_time.push(nodePara.Pg_startT[i][x]+" - "+nodePara.Pg_endT[i][x]);
                    }
                }

                nodePara.Pg_outT[i][x] = (parseFloat(nodePara.Pg_outT[i][x])>0?nodePara.Pg_outT[i][x]:"");
            }

            
            //console.info(nodePara.Pg_flag_bits[i])
            //console.info(nodePara.Pg_rev_bits[i])
            
            vm.Pg_para.push({
                Pg_gday:nodePara.Pg_gday[i],
                //Pg_startT:nodePara.Pg_startT[i],
                //Pg_endT:nodePara.Pg_endT[i],
                Pg_outT:nodePara.Pg_outT[i],
                Pg_waterFeed:nodePara.Pg_waterFeed[i],
                Pg_firstFeed:nodePara.Pg_firstFeed[i],
                Pg_ftbFeed:nodePara.Pg_ftbFeed[i],
                Pg_tbFeed:nodePara.Pg_tbFeed[i],
                Pg_wgapTime:nodePara.Pg_wgapTime[i],
                Pg_cw:nodePara.Pg_cw[i],
                Pg_autoFeed:nodePara.Pg_autoFeed[i],
                Pg_fgapTime:nodePara.Pg_fgapTime[i],
                Pg_flag:nodePara.Pg_flag[i],
                Pg_flag_bits:nodePara.Pg_flag_bits[i],
                Pg_rev:nodePara.Pg_rev[i],
                Pg_rev_bits:nodePara.Pg_rev_bits[i],

                Pg_feed_num:Pg_feed_num,
                Pg_time:Pg_time,
                Pg_total_feed:parseFloat(Pg_total_feed.toFixed(2)),
            });
            console.info("vm.Pg_para",JSON.stringify(vm.Pg_para));
        }

        //哺乳
        vm.La_para = [];
        //兼容之前方案
        if(nodePara.La_rev_bits){
        }else{
            nodePara.La_rev_bits = [[false,true,false,true,true,false,false,false],[false,true,false,true,true,false,false,false],[false,true,false,true,true,false,false,false],[false,true,false,true,true,false,false,false],[false,true,false,true,true,false,false,false],[false,true,false,true,true,false,false,false],[false,true,false,true,true,false,false,false],[false,false,false,false,false,false,false,false]];
        }
        
        for(var i=0;i<nodePara.La_gday.length;i++)
        {
            //计算当日总料量
            var La_feed_num = 0;
            var La_total_feed = 0;
            var La_time = [];
            
            for(var x=0;x<nodePara.La_startT[i].length;x++){
                

                if(nodePara.La_startT[i][x]!="00:00" || nodePara.La_endT[i][x]!="00:00"){
                    La_time.push(nodePara.La_startT[i][x]+" - "+nodePara.La_endT[i][x]);
                    if(nodePara.La_outT[i][x]=="" || isNaN(nodePara.La_outT[i][x])){
                        La_total_feed += 0;
                    }else{
                        La_total_feed += parseFloat(nodePara.La_outT[i][x]);
                    }
                    //La_total_feed += parseFloat(nodePara.La_outT[i][x]);
                    La_feed_num+=1;
                }else{
                    if(no_display_zero){
                        La_time.push("");
                    }
                    else{
                        La_time.push(nodePara.La_startT[i][x]+" - "+nodePara.La_endT[i][x]);
                    }
                }

                nodePara.La_outT[i][x] = (parseFloat(nodePara.La_outT[i][x])>0?nodePara.La_outT[i][x]:"");
            }
            
            vm.La_para.push({
                La_gday:nodePara.La_gday[i],
                La_startT:nodePara.La_startT[i],
                La_endT:nodePara.La_endT[i],
                La_outT:nodePara.La_outT[i],
                La_waterFeed:nodePara.La_waterFeed[i],
                La_firstFeed:nodePara.La_firstFeed[i],
                La_ftbFeed:nodePara.La_ftbFeed[i],
                La_tbFeed:nodePara.La_tbFeed[i],
                La_wgapTime:nodePara.La_wgapTime[i],
                La_cw:nodePara.La_cw[i],
                La_autoFeed:nodePara.La_autoFeed[i],
                La_fgapTime:nodePara.La_fgapTime[i],
                La_flag:nodePara.La_flag[i],
                La_flag_bits:nodePara.La_flag_bits[i],
                La_rev:nodePara.La_rev[i],
                La_rev_bits:nodePara.La_rev_bits[i],

                La_feed_num:La_feed_num,
                La_time:La_time,
                La_total_feed:parseFloat(La_total_feed.toFixed(2)),
            });
        }
        console.info("vm.La_para",JSON.stringify(vm.La_para));
        

        //保育
        vm.Nr_para = [];
        //兼容之前方案
        if(nodePara.Nr_flag_bits){
        }else{
            nodePara.Nr_flag_bits = [[false,false,false,false,false,false,false,false],[false,false,false,false,false,false,false,false],[false,false,false,false,false,false,false,false],[false,false,false,false,false,false,false,false],[false,false,false,false,false,false,false,false],[false,false,false,false,false,false,false,false]];
        }
        for(var i=0;i<nodePara.Nr_gday.length;i++)
        {
            //计算当日总料量
            var Nr_time = [];
            
            for(var x=0;x<nodePara.Nr_startT[i].length;x++){
                //Nr_time.push(nodePara.Nr_startT[i][x]+" - "+nodePara.Nr_endT[i][x]);

                if(nodePara.Nr_startT[i][x]!="00:00" || nodePara.Nr_endT[i][x]!="00:00"){
                    Nr_time.push(nodePara.Nr_startT[i][x]+" - "+nodePara.Nr_endT[i][x]);
                }else{
                    if(no_display_zero){
                        Nr_time.push("");
                    }
                    else{
                        Nr_time.push(nodePara.Nr_startT[i][x]+" - "+nodePara.Nr_endT[i][x]);
                    }
                }
            }
            vm.Nr_para.push({
                Nr_gday:nodePara.Nr_gday[i],
                Nr_startT:nodePara.Nr_startT[i],
                Nr_endT:nodePara.Nr_endT[i],
                
                Nr_waterFeed:nodePara.Nr_waterFeed[i],
                Nr_autoFeed:nodePara.Nr_autoFeed[i],
                Nr_fgapTime:nodePara.Nr_fgapTime[i],
                Nr_wgapTime:nodePara.Nr_wgapTime[i],
                Nr_cw:nodePara.Nr_cw[i],
                Nr_flag:nodePara.Nr_flag[i],
                Nr_flag_bits:nodePara.Nr_flag_bits[i],

                Nr_time:Nr_time,
            });
        }

        //育肥
        vm.Fat_para = [];
        //兼容之前方案
        if(nodePara.Fat_flag_bits){
        }else{
            nodePara.Fat_flag_bits = [[false,false,false,false,false,false,false,false],[false,false,false,false,false,false,false,false],[false,false,false,false,false,false,false,false],[false,false,false,false,false,false,false,false],[false,false,false,false,false,false,false,false],[false,false,false,false,false,false,false,false]];
        }
        for(var i=0;i<nodePara.Fat_gday.length;i++)
        {
            //计算当日总料量
            var Fat_time = [];
            
            for(var x=0;x<nodePara.Fat_startT[i].length;x++){
                //Fat_time.push(nodePara.Fat_startT[i][x]+" - "+nodePara.Fat_endT[i][x]);
                if(nodePara.Fat_startT[i][x]!="00:00" || nodePara.Fat_endT[i][x]!="00:00"){
                    Fat_time.push(nodePara.Fat_startT[i][x]+" - "+nodePara.Fat_endT[i][x]);
                }else{
                    if(no_display_zero){
                        Fat_time.push("");
                    }
                    else{
                        Fat_time.push(nodePara.Fat_startT[i][x]+" - "+nodePara.Fat_endT[i][x]);
                    }
                }
            }
            vm.Fat_para.push({
                Fat_gday:nodePara.Fat_gday[i],
                Fat_startT:nodePara.Fat_startT[i],
                Fat_endT:nodePara.Fat_endT[i],
                
                Fat_waterFeed:nodePara.Fat_waterFeed[i],
                Fat_autoFeed:nodePara.Fat_autoFeed[i],
                Fat_fgapTime:nodePara.Fat_fgapTime[i],
                Fat_wgapTime:nodePara.Fat_wgapTime[i],
                Fat_cw:nodePara.Fat_cw[i],
                Fat_flag:nodePara.Fat_flag[i],
                Fat_flag_bits:nodePara.Fat_flag_bits[i],

                Fat_time:Fat_time,
            });
        }

        //定时
        vm.Tmr_para = {};
        var Tmr_time = [];
        var Tmr_feed_num = 0;
        var Tmr_total_feed = 0;

        for(var i=0;i<nodePara.Tmr_startT.length;i++)
        {
            
            /*if(nodePara.Tmr_startT[i]!="00:00" || nodePara.Tmr_endT[i]!="00:00"){
                Tmr_total_feed += parseFloat(nodePara.Tmr_outT[i]);
                Tmr_feed_num+=1;
            }
            Tmr_time.push(nodePara.Tmr_startT[i]+" - "+nodePara.Tmr_endT[i]);*/

            if(nodePara.Tmr_startT[i]!="00:00" || nodePara.Tmr_endT[i]!="00:00"){
                if(nodePara.Tmr_outT[i]=="" || isNaN(nodePara.Tmr_outT[i])){
                    Tmr_total_feed += 0;
                }else{
                    Tmr_total_feed += parseFloat(nodePara.Tmr_outT[i]);
                }
                //Tmr_total_feed += parseFloat(nodePara.Tmr_outT[i]);
                Tmr_feed_num+=1;
                Tmr_time.push(nodePara.Tmr_startT[i]+" - "+nodePara.Tmr_endT[i]);
            }else{
                if(no_display_zero){
                    Tmr_time.push("");
                }
                else{
                    Tmr_time.push(nodePara.Tmr_startT[i]+" - "+nodePara.Tmr_endT[i]);
                }
            }
            nodePara.Tmr_outT[i] = (parseFloat(nodePara.Tmr_outT[i])>0?nodePara.Tmr_outT[i]:"");
        }
        vm.Tmr_para = {
            Tmr_outT:nodePara.Tmr_outT,
            Tmr_waterFeed:nodePara.Tmr_waterFeed,
            Tmr_wgapTime:nodePara.Tmr_wgapTime,
            Tmr_cw:nodePara.Tmr_cw,
            Tmr_flag:nodePara.Tmr_flag,

            Tmr_time:Tmr_time,
            Tmr_feed_num:Tmr_feed_num,
            Tmr_total_feed:Tmr_total_feed,
            Tmr_flag_bits:nodePara.Tmr_flag_bits,
        };

        vm.node_para = nodePara;
        //console.info("nodePara",JSON.stringify(nodePara));

        vm.$forceUpdate();
        setTimeout(function(){checkPermission();},500);
        resize();
    }
    
    //转换保护时间单位为秒
    function changePUnitSeconds(){
        for(var i=0;i<vm.Pg_para.length;i++){
            vm.Pg_para[i].Pg_wgapTime =Math.round(vm.Pg_para[i].Pg_wgapTime * 60).toString();
        }
        for(var i=0;i<vm.La_para.length;i++){
            vm.La_para[i].La_wgapTime = Math.round(vm.La_para[i].La_wgapTime * 60).toString();
        }
        for(var i=0;i<vm.Nr_para.length;i++){
            vm.Nr_para[i].Nr_fgapTime = Math.round(vm.Nr_para[i].Nr_fgapTime * 60).toString();
            vm.Nr_para[i].Nr_wgapTime = Math.round(vm.Nr_para[i].Nr_wgapTime * 60).toString();
        }
        for(var i=0;i<vm.Fat_para.length;i++){
            vm.Fat_para[i].Fat_fgapTime = Math.round(vm.Fat_para[i].Fat_fgapTime * 60).toString();
            vm.Fat_para[i].Fat_wgapTime = Math.round(vm.Fat_para[i].Fat_wgapTime * 60).toString();
        }

        vm.Tmr_para.Tmr_wgapTime = Math.round(vm.Tmr_para.Tmr_wgapTime * 60).toString();

        vm.$forceUpdate();
        setTimeout(function(){checkPermission();},500);
        resize();
    }

    //转换保护时间单位为分钟
    function changePUnitMinute(){
        for(var i=0;i<vm.Pg_para.length;i++){
            vm.Pg_para[i].Pg_wgapTime = Math.round(vm.Pg_para[i].Pg_wgapTime / 60).toString();
            if(vm.Pg_para[i].Pg_wgapTime<1){
                vm.Pg_para[i].Pg_wgapTime = 1;
            }
        }
        for(var i=0;i<vm.La_para.length;i++){
            vm.La_para[i].La_wgapTime = Math.round(vm.La_para[i].La_wgapTime / 60).toString();
            if(vm.La_para[i].La_wgapTime<1){
                vm.La_para[i].La_wgapTime = 1;
            }
        }
        for(var i=0;i<vm.Nr_para.length;i++){
            vm.Nr_para[i].Nr_fgapTime = Math.round(vm.Nr_para[i].Nr_fgapTime / 60).toString();
            vm.Nr_para[i].Nr_wgapTime = Math.round(vm.Nr_para[i].Nr_wgapTime / 60).toString();
            if(vm.Nr_para[i].Nr_fgapTime<1){
                vm.Nr_para[i].Nr_fgapTime = 1;
            }
            if(vm.Nr_para[i].Nr_wgapTime<1){
                vm.Nr_para[i].Nr_wgapTime = 1;
            }
        }
        for(var i=0;i<vm.Fat_para.length;i++){
            vm.Fat_para[i].Fat_fgapTime = Math.round(vm.Fat_para[i].Fat_fgapTime / 60).toString();
            vm.Fat_para[i].Fat_wgapTime = Math.round(vm.Fat_para[i].Fat_wgapTime / 60).toString();
            if(vm.Fat_para[i].Fat_fgapTime<1){
                vm.Fat_para[i].Fat_fgapTime = 1;
            }
            if(vm.Fat_para[i].Fat_wgapTime<1){
                vm.Fat_para[i].Fat_wgapTime = 1;
            }
        }

        vm.Tmr_para.Tmr_wgapTime = Math.round(vm.Tmr_para.Tmr_wgapTime / 60).toString();
        if(vm.Tmr_para.Tmr_wgapTime<1){
            vm.Tmr_para.Tmr_wgapTime= 1;
        }

        vm.$forceUpdate();
        setTimeout(function(){checkPermission();},500);
        resize();
    }
    
    
    function onSave(){
        console.info("onSave");
        savePlan();
    }

    function savePlan(){
        //方案参数
        var form_plan = form.val("form_plan");
        console.info(form_plan);
        
        if(form_plan.group_code.length==0){
            toastr.warning("集团必须选择");
            return;
        }
        if(form_plan.name.length==0){
            toastr.warning("方案名称 必须填写");
            return;
        }

        //基本参数获取
        var form_node_param = form.val("form_node_param");
        var enable = (form_node_param._Enable=="on"?"1":"0");
        vm.node_para.EnWater = (form_node_param._EnWater=="on"?"1":"0");
        vm.node_para.EnTB = (form_node_param._EnTB=="on"?"1":"0");
        //vm.node_para.Mode = form_node_param.Mode;
        console.info(form_node_param);

        //妊娠
        for(var i=0;i<vm.Pg_para.length;i++)
        {
            vm.node_para.Pg_gday[i] = vm.Pg_para[i].Pg_gday;
            //处理时间
            var time = vm.Pg_para[i].Pg_time;
            var outT = vm.Pg_para[i].Pg_outT;
            
            for(var x=0;x<time.length;x++)
            {
                if(time[x]==""){
                    vm.node_para.Pg_startT[i][x] = "00:00";
                    vm.node_para.Pg_endT[i][x] = "00:00";
                }
                else{
                    var time_arr = time[x].split("-");
                    vm.node_para.Pg_startT[i][x] = time_arr[0].trim();
                    vm.node_para.Pg_endT[i][x] = time_arr[1].trim();
                }
            }

            if(outT==""){
                outT = ["0","0","0","0","0","0"];
            }
            vm.node_para.Pg_outT[i] = outT;
            vm.node_para.Pg_waterFeed[i] = vm.Pg_para[i].Pg_waterFeed;
            vm.node_para.Pg_firstFeed[i] = vm.Pg_para[i].Pg_firstFeed;
            vm.node_para.Pg_ftbFeed[i] = vm.Pg_para[i].Pg_ftbFeed;
            vm.node_para.Pg_tbFeed[i] = vm.Pg_para[i].Pg_tbFeed;
            vm.node_para.Pg_wgapTime[i] = vm.Pg_para[i].Pg_wgapTime.toString();
            vm.node_para.Pg_cw[i] = vm.Pg_para[i].Pg_cw;
            vm.node_para.Pg_autoFeed[i] = vm.Pg_para[i].Pg_autoFeed;
            vm.node_para.Pg_fgapTime[i] = vm.Pg_para[i].Pg_fgapTime.toString();
            vm.node_para.Pg_flag_bits[i] = vm.Pg_para[i].Pg_flag_bits;
            vm.node_para.Pg_flag[i] = vm.Pg_para[i].Pg_flag;
            vm.node_para.Pg_rev_bits[i] = vm.Pg_para[i].Pg_rev_bits;
            vm.node_para.Pg_rev[i] = vm.Pg_para[i].Pg_rev;
        }


        //哺乳
        for(var i=0;i<vm.La_para.length;i++)
        {
            vm.node_para.La_gday[i] = vm.La_para[i].La_gday;
            //处理时间
            var time = vm.La_para[i].La_time;
            var outT = vm.La_para[i].La_outT;
            for(var x=0;x<time.length;x++)
            {
                if(time[x]==""){
                    vm.node_para.La_startT[i][x] = "00:00";
                    vm.node_para.La_endT[i][x] = "00:00";
                }
                else{
                    var time_arr = time[x].split("-");
                    vm.node_para.La_startT[i][x] = time_arr[0].trim();
                    vm.node_para.La_endT[i][x] = time_arr[1].trim();
                }
            }
            if(outT==""){
                outT = ["0","0","0","0","0","0"];
            }
            vm.node_para.La_outT[i] = outT;
            vm.node_para.La_waterFeed[i] = vm.La_para[i].La_waterFeed;
            vm.node_para.La_firstFeed[i] = vm.La_para[i].La_firstFeed;
            vm.node_para.La_ftbFeed[i] = vm.La_para[i].La_ftbFeed;
            vm.node_para.La_tbFeed[i] = vm.La_para[i].La_tbFeed;
            vm.node_para.La_wgapTime[i] = vm.La_para[i].La_wgapTime.toString();
            vm.node_para.La_cw[i] = vm.La_para[i].La_cw;
            vm.node_para.La_autoFeed[i] = vm.La_para[i].La_autoFeed;
            vm.node_para.La_fgapTime[i] = vm.La_para[i].La_fgapTime.toString();
            vm.node_para.La_flag_bits[i] = vm.La_para[i].La_flag_bits;
            vm.node_para.La_flag[i] = vm.La_para[i].La_flag;
            vm.node_para.La_rev_bits[i] = vm.La_para[i].La_rev_bits;
            vm.node_para.La_rev[i] = vm.La_para[i].La_rev;
        }

        //保育
        for(var i=0;i<vm.Nr_para.length;i++)
        {
            vm.node_para.Nr_gday[i] = vm.Nr_para[i].Nr_gday;
            //处理时间
            var time = vm.Nr_para[i].Nr_time;
            
            for(var x=0;x<time.length;x++)
            {
                if(time[x]==""){
                    vm.node_para.Nr_startT[i][x] = "00:00";
                    vm.node_para.Nr_endT[i][x] = "00:00";
                }
                else{
                    var time_arr = time[x].split("-");
                    vm.node_para.Nr_startT[i][x] = time_arr[0].trim();
                    vm.node_para.Nr_endT[i][x] = time_arr[1].trim();
                }
                
            }
            vm.node_para.Nr_waterFeed[i] = vm.Nr_para[i].Nr_waterFeed;
            vm.node_para.Nr_autoFeed[i] = vm.Nr_para[i].Nr_autoFeed;
            vm.node_para.Nr_fgapTime[i] = vm.Nr_para[i].Nr_fgapTime.toString();
            vm.node_para.Nr_wgapTime[i] = vm.Nr_para[i].Nr_wgapTime.toString();
            vm.node_para.Nr_cw[i] = vm.Nr_para[i].Nr_cw;
            vm.node_para.Nr_flag[i] = vm.Nr_para[i].Nr_flag;
        }

        //育肥
        for(var i=0;i<vm.Fat_para.length;i++)
        {
            vm.node_para.Fat_gday[i] = vm.Fat_para[i].Fat_gday;
            //处理时间
            var time = vm.Fat_para[i].Fat_time;
            
            for(var x=0;x<time.length;x++)
            {
                if(time[x]==""){
                    vm.node_para.Fat_startT[i][x] = "00:00";
                    vm.node_para.Fat_endT[i][x] = "00:00";
                }
                else{
                    var time_arr = time[x].split("-");
                    vm.node_para.Fat_startT[i][x] = time_arr[0].trim();
                    vm.node_para.Fat_endT[i][x] = time_arr[1].trim();
                }
            }
            vm.node_para.Fat_waterFeed[i] = vm.Fat_para[i].Fat_waterFeed;
            vm.node_para.Fat_autoFeed[i] = vm.Fat_para[i].Fat_autoFeed;
            vm.node_para.Fat_fgapTime[i] = vm.Fat_para[i].Fat_fgapTime.toString();
            vm.node_para.Fat_wgapTime[i] = vm.Fat_para[i].Fat_wgapTime.toString();
            vm.node_para.Fat_cw[i] = vm.Fat_para[i].Fat_cw;
            vm.node_para.Fat_flag[i] = vm.Fat_para[i].Fat_flag;
        }

        //定时
        for(var i=0;i<vm.Tmr_para.Tmr_time.length;i++)
        {
            if(vm.Tmr_para.Tmr_time[i]==""){
                vm.node_para.Tmr_startT[i] = "00:00";
                vm.node_para.Tmr_endT[i] = "00:00";
            }
            else{
                var time_arr = vm.Tmr_para.Tmr_time[i].split("-");
                vm.node_para.Tmr_startT[i] = time_arr[0].trim();
                vm.node_para.Tmr_endT[i] = time_arr[1].trim();
            }
            
        }
        vm.node_para.Tmr_outT = vm.Tmr_para.Tmr_outT;
        vm.node_para.Tmr_waterFeed = vm.Tmr_para.Tmr_waterFeed;
        vm.node_para.Tmr_wgapTime = vm.Tmr_para.Tmr_wgapTime.toString();
        vm.node_para.Tmr_cw = vm.Tmr_para.Tmr_cw;
        vm.node_para.Tmr_flag = vm.Tmr_para.Tmr_flag;
        vm.node_para.Tmr_flag_bits = vm.Tmr_para.Tmr_flag_bits;
        if(form_node_param._EnAutoSwitchGrowthMode=="on"){
            vm.node_para.Tmr_flag_bits[1] = true;
        }else{
            vm.node_para.Tmr_flag_bits[1] = false;
        }
        // if(form_node_param._EnFirstTouchAsFirstFeed=="on"){
        //     vm.node_para.Tmr_flag_bits[2] = true;
        // }else{
        //     vm.node_para.Tmr_flag_bits[2] = false;
        // }
        vm.node_para.Tmr_flag_bits[2] = true; //20240715 先默认打开且隐藏首次触碰当诱食处理

        if(form_node_param._EnMotorCurProtect=="on"){
            vm.node_para.Tmr_flag_bits[3] = false;
        }else{
            vm.node_para.Tmr_flag_bits[3] = true;
        }
        if(form_node_param._EnMotorCurIdle=="on"){
            vm.node_para.Tmr_flag_bits[4] = true;
        }else{
            vm.node_para.Tmr_flag_bits[4] = false;
        }
        if(vm.wp_unit>0){
            vm.node_para.Tmr_flag_bits[5] = true;
        }else{
            vm.node_para.Tmr_flag_bits[5] = false;
        }
        console.info(vm.node_para.Tmr_flag_bits);

        //兼容26版本
        
        
        vm.node_para.Sn = 99999999;
        vm.node_para.Gday = 1;
        //return;
        console.info(request);
        console.info(JSON.stringify(vm.node_para));

        //校验部分数据
        var err='';
        if(vm.wp_unit==1)
        {
            for(var i=0;i<vm.node_para.Pg_wgapTime.length;i++){
                if(vm.node_para.Pg_gday[i]>0){
                    if(vm.node_para.Pg_wgapTime[i]<10){
                        err = "妊娠模式下水保护时间不能小于10秒"
                        break;
                    }
                }
            }

            for(var i=0;i<vm.node_para.La_wgapTime.length;i++){
                if(vm.node_para.La_gday[i]>0){
                    if(vm.node_para.La_wgapTime[i]<10){
                        err = "哺乳模式下水保护时间不能小于10秒"
                        break;
                    }
                }
            }

            for(var i=0;i<vm.node_para.Nr_fgapTime.length;i++){
                if(vm.node_para.Nr_gday[i]>0){
                    if(vm.node_para.Nr_fgapTime[i]<10){
                        err = "保育模式自动出料时间保护不能小于10秒"
                        break;
                    }
                    if(vm.node_para.Nr_wgapTime[i]<10){
                        err = "保育模式自动出水保护时间不能小于10秒"
                        break;
                    }
                }
            }

            for(var i=0;i<vm.node_para.Fat_fgapTime.length;i++){
                if(vm.node_para.Fat_gday[i]>0){
                    if(vm.node_para.Fat_fgapTime[i]<10){
                        err = "育肥模式自动出料时间保护不能小于10秒"
                        break;
                    }
                    if(vm.node_para.Fat_wgapTime[i]<10){
                        err = "育肥模式自动出水保护时间不能小于10秒"
                        break;
                    }
                }
            }
        }
        else if(vm.wp_unit==0){
            for(var i=0;i<vm.node_para.Pg_wgapTime.length;i++){
                if(vm.node_para.Pg_gday[i]>0){
                    if(vm.node_para.Pg_wgapTime[i]==0){
                        err = "妊娠模式下水保护时间不能为0"
                        break;
                    }
                }
            }

            for(var i=0;i<vm.node_para.La_wgapTime.length;i++){
                if(vm.node_para.La_gday[i]>0){
                    if(vm.node_para.La_wgapTime[i]==0){
                        err = "哺乳模式下水保护时间不能为0"
                        break;
                    }
                }
            }

            for(var i=0;i<vm.node_para.Nr_fgapTime.length;i++){
                if(vm.node_para.Nr_gday[i]>0){
                    if(vm.node_para.Nr_fgapTime[i]==0){
                        err = "保育模式自动出料时间保护不能为0"
                        break;
                    }
                    if(vm.node_para.Nr_wgapTime[i]==0){
                        err = "保育模式自动出水保护时间不能为0"
                        break;
                    }
                }
            }

            for(var i=0;i<vm.node_para.Fat_fgapTime.length;i++){
                if(vm.node_para.Fat_gday[i]>0){
                    if(vm.node_para.Fat_fgapTime[i]==0){
                        err = "育肥模式自动出料时间保护不能为0"
                        break;
                    }
                    if(vm.node_para.Fat_wgapTime[i]==0){
                        err = "育肥模式自动出水保护时间不能为0"
                        break;
                    }
                }
            }
        }

        if(err!=""){
            layer.alert(err);
            return;
        }
        
        layer.load(1);
        var type="";
        if(request.id){
            type="PUT";
        }else{
            type="POST"
        }
        $.ajax({
            type: type,
            url: '../Api/FeedPlanNew',
            data: {id:request.id,model:'feed',para:JSON.stringify(vm.node_para),name:form_plan.name,group_code:form_plan.group_code,farmid:form_plan.farmid,remark:form_plan.remark,food_plan:form_plan.food_plan,food_type:form_plan.food_type,name:form_plan.name},
            beforeSend: function(request) {
                request.setRequestHeader("Authorization", 'Bearer '+window.localStorage.getItem("token"));
            },
            dataType: "json",
            success: function (res) {
                //console.info(data)
                if(res.code>=0){
                    toastr.success("保存成功");
                    //layui.table.reload('table'); //重载表格
                    //layer.close(lay_index); //再执行关闭
                }else{
                    toastr.warning(res.msg, "异常");
                    //layer.alert('保存失败:'+data.msg);
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                layer.alert('保存失败');
            },
            complete: function(XMLHttpRequest, textStatus) {
                layer.closeAll('loading');
            }
        });
        
    }

    function onRefresh(){
        loadPara(request);
    }

    //清空对应模式下方案参数
    function onClearAll(){
        console.info(vm.mode);
        //妊娠
        if(vm.mode==EMODE_PG_NEW){
            for(var i=0;i<vm.Pg_para.length;i++)
            {
                
                for(var x=0;x<vm.Pg_para[i].Pg_time.length;x++){
                    vm.Pg_para[i].Pg_time[x]="00:00 - 00:00";
                    //vm.Pg_para[i].Pg_startT[x]="00:00";
                    //vm.Pg_para[i].Pg_endT[x]="00:00";
                    vm.Pg_para[i].Pg_outT[x]="0";
                }
                vm.Pg_para[i].Pg_gday = "0";
                vm.Pg_para[i].Pg_waterFeed = "0";
                vm.Pg_para[i].Pg_firstFeed = "0";
                vm.Pg_para[i].Pg_ftbFeed = "0";
                vm.Pg_para[i].Pg_tbFeed = "0";
                vm.Pg_para[i].Pg_wgapTime = "0";
                vm.Pg_para[i].Pg_cw = "0";
                vm.Pg_para[i].Pg_autoFeed = "0";
                vm.Pg_para[i].Pg_fgapTime = "0";
                vm.Pg_para[i].Pg_flag = "0";

                vm.Pg_para[i].Pg_feed_num = "0";
                vm.Pg_para[i].Pg_total_feed = "0";
            }
        }
        else if(vm.mode==EMODE_LACTATION_NEW){
            for(var i=0;i<vm.La_para.length;i++)
            {
                
                for(var x=0;x<vm.La_para[i].La_time.length;x++){
                    vm.La_para[i].La_time[x]="00:00 - 00:00";
                    //vm.La_para[i].La_startT[x]="00:00";
                    //vm.La_para[i].La_endT[x]="00:00";
                    vm.La_para[i].La_outT[x]="0";
                }
                vm.La_para[i].La_gday = "0";
                vm.La_para[i].La_waterFeed = "0";
                vm.La_para[i].La_firstFeed = "0";
                vm.La_para[i].La_ftbFeed = "0";
                vm.La_para[i].La_tbFeed = "0";
                vm.La_para[i].La_wgapTime = "0";
                vm.La_para[i].La_cw = "0";
                vm.La_para[i].La_autoFeed = "0";
                vm.La_para[i].La_fgapTime = "0";
                vm.La_para[i].La_flag = "0";

                vm.La_para[i].La_feed_num = "0";
                vm.La_para[i].La_total_feed = "0";
            }
        }
        else if(vm.mode==EMODE_NURSE_NEW){
            for(var i=0;i<vm.Nr_para.length;i++)
            {
                
                for(var x=0;x<vm.Nr_para[i].Nr_time.length;x++){
                    vm.Nr_para[i].Nr_time[x]="00:00 - 00:00";
                    //vm.Nr_para[i].Nr_startT[x]="00:00";
                    //vm.Nr_para[i].Nr_endT[x]="00:00";
                }
                vm.Nr_para[i].Nr_gday = "0";
                vm.Nr_para[i].Nr_waterFeed = "0";
                vm.Nr_para[i].Nr_autoFeed = "0";
                vm.Nr_para[i].Nr_fgapTime = "0";
                vm.Nr_para[i].Nr_wgapTime = "0";
                vm.Nr_para[i].Nr_cw = "0";
                vm.Nr_para[i].Nr_flag = "0";
            }
        }
        else if(vm.mode==EMODE_FAT_NEW){
            for(var i=0;i<vm.Fat_para.length;i++)
            {
                
                for(var x=0;x<vm.Fat_para[i].Fat_time.length;x++){
                    vm.Fat_para[i].Fat_time[x]="00:00 - 00:00";
                    //vm.Fat_para[i].Fat_startT[x]="00:00";
                    //vm.Fat_para[i].Fat_endT[x]="00:00";
                }
                vm.Fat_para[i].Fat_gday = "0";
                vm.Fat_para[i].Fat_waterFeed = "0";
                vm.Fat_para[i].Fat_autoFeed = "0";
                vm.Fat_para[i].Fat_fgapTime = "0";
                vm.Fat_para[i].Fat_wgapTime = "0";
                vm.Fat_para[i].Fat_cw = "0";
                vm.Fat_para[i].Fat_flag = "0";
            }
        }
        else if(vm.mode==EMODE_TIMER_NEW){
            for(var x=0;x<vm.Tmr_para.Tmr_time.length;x++)
            {
                vm.Tmr_para.Tmr_time[x]="00:00 - 00:00";
                vm.Tmr_para.Tmr_outT[x]="0";
            }
            vm.Tmr_para.Tmr_waterFeed = "0";
            vm.Tmr_para.Tmr_wgapTime = "0";
            vm.Tmr_para.Tmr_cw = "0";
            vm.Tmr_para.Tmr_flag = "0";

            vm.Tmr_para.Tmr_feed_num = "0";
            vm.Tmr_para.Tmr_total_feed = "0";
        }

        vm.$forceUpdate();
    }


    function onClearLine(item,i){
        console.info(item,i);
        if(vm.mode==EMODE_PG_NEW){
            for(var x=0;x<vm.Pg_para[i].Pg_time.length;x++){
                vm.Pg_para[i].Pg_time[x]="00:00 - 00:00";
                //vm.Pg_para[i].Pg_startT[x]="00:00";
                //vm.Pg_para[i].Pg_endT[x]="00:00";
                vm.Pg_para[i].Pg_outT[x]="0";
            }
            vm.Pg_para[i].Pg_gday = "0";
            vm.Pg_para[i].Pg_waterFeed = "0";
            vm.Pg_para[i].Pg_firstFeed = "0";
            vm.Pg_para[i].Pg_ftbFeed = "0";
            vm.Pg_para[i].Pg_tbFeed = "0";
            vm.Pg_para[i].Pg_wgapTime = "0";
            vm.Pg_para[i].Pg_cw = "0";
            vm.Pg_para[i].Pg_autoFeed = "0";
            vm.Pg_para[i].Pg_fgapTime = "0";
            vm.Pg_para[i].Pg_flag = "0";

            vm.Pg_para[i].Pg_feed_num = "0";
            vm.Pg_para[i].Pg_total_feed = "0";
        }
        else if(vm.mode==EMODE_LACTATION_NEW){
            for(var x=0;x<vm.La_para[i].La_time.length;x++){
                vm.La_para[i].La_time[x]="00:00 - 00:00";
                //vm.La_para[i].La_startT[x]="00:00";
                //vm.La_para[i].La_endT[x]="00:00";
                vm.La_para[i].La_outT[x]="0";
            }
            vm.La_para[i].La_gday = "0";
            vm.La_para[i].La_waterFeed = "0";
            vm.La_para[i].La_firstFeed = "0";
            vm.La_para[i].La_ftbFeed = "0";
            vm.La_para[i].La_tbFeed = "0";
            vm.La_para[i].La_wgapTime = "0";
            vm.La_para[i].La_cw = "0";
            vm.La_para[i].La_autoFeed = "0";
            vm.La_para[i].La_fgapTime = "0";
            vm.La_para[i].La_flag = "0";

            vm.La_para[i].La_feed_num = "0";
            vm.La_para[i].La_total_feed = "0";
        }
        else if(vm.mode==EMODE_NURSE_NEW){
            for(var x=0;x<vm.Nr_para[i].Nr_time.length;x++){
                vm.Nr_para[i].Nr_time[x]="00:00 - 00:00";
                //vm.Nr_para[i].Nr_startT[x]="00:00";
                //vm.Nr_para[i].Nr_endT[x]="00:00";
            }
            vm.Nr_para[i].Nr_gday = "0";
            vm.Nr_para[i].Nr_waterFeed = "0";
            vm.Nr_para[i].Nr_autoFeed = "0";
            vm.Nr_para[i].Nr_fgapTime = "0";
            vm.Nr_para[i].Nr_wgapTime = "0";
            vm.Nr_para[i].Nr_cw = "0";
            vm.Nr_para[i].Nr_flag = "0";
        }
        else if(vm.mode==EMODE_FAT_NEW){
            for(var x=0;x<vm.Fat_para[i].Fat_time.length;x++){
                vm.Fat_para[i].Fat_time[x]="00:00 - 00:00";
                //vm.Fat_para[i].Fat_startT[x]="00:00";
                //vm.Fat_para[i].Fat_endT[x]="00:00";
            }
            vm.Fat_para[i].Fat_gday = "0";
            vm.Fat_para[i].Fat_waterFeed = "0";
            vm.Fat_para[i].Fat_autoFeed = "0";
            vm.Fat_para[i].Fat_fgapTime = "0";
            vm.Fat_para[i].Fat_wgapTime = "0";
            vm.Fat_para[i].Fat_cw = "0";
            vm.Fat_para[i].Fat_flag = "0";
        }
        else if(vm.mode==EMODE_TIMER_NEW){
            for(var x=0;x<vm.Tmr_para.Tmr_time.length;x++)
            {
                vm.Tmr_para.Tmr_time[x]="00:00 - 00:00";
                vm.Tmr_para.Tmr_outT[x]="0";
            }
            vm.Tmr_para.Tmr_waterFeed = "0";
            vm.Tmr_para.Tmr_wgapTime = "0";
            vm.Tmr_para.Tmr_cw = "0";
            vm.Tmr_para.Tmr_flag = "0";

            vm.Tmr_para.Tmr_feed_num = "0";
            vm.Tmr_para.Tmr_total_feed = "0";
        }
        vm.$forceUpdate();
    }

    //使用对应模式下方案默认参数
    function onApplyDefault(){
        
    
        if(nodePara){
            var Sn = nodePara.Sn;
            var Passwd = nodePara.Passwd;
            var Gday = nodePara.Gday;
            var Hnum = nodePara.Hnum;
            var Mode = vm.mode;
            
            nodePara =JSON.parse(JSON.stringify(DEFAULT_ITEM_PARA));
            nodePara.Sn = Sn;
            nodePara.Passwd = Passwd;
            nodePara.Gday = Gday;
            nodePara.Hnum = Hnum;
            nodePara.Mode = Mode;
        }else{
            nodePara = JSON.parse(JSON.stringify(DEFAULT_ITEM_PARA));
            console.info("request.mode",request.mode);
            nodePara.Mode = request.mode;
            if(nodePara.Mode==1 || nodePara.Mode==2){
                nodePara.CalAD = "3000";
                nodePara.CalADR = "3500";
                nodePara.CalFeed = "3200";
                nodePara.WaterPTTO = "4";
            }else if(nodePara.Mode==3 || nodePara.Mode==4){
                nodePara.CalAD = "1900";
                nodePara.CalADR = "2400";
                nodePara.CalFeed = "1000";
                nodePara.WaterPTTO = "4";
            }
        }

        //兼容26版本
        if(nodePara.ReverseTimes){
            nodePara.WaterDelay = nodePara.ReverseTimes;
        }
        if(nodePara.ReverseTurns){
            nodePara.PtTimeDelay = nodePara.ReverseTurns;
        }

        //兼容26版本
        nodePara.CurIdle = "65";

        console.info(nodePara);
        disPlayNode(nodePara,1);


    }

    function onMaxSize(){
        var url = window.location.href;
        if(url.indexOf('?')>=0){
            url+="&max=1";
        }else{
            url+="?max=1";
        }
        console.info(url);
        window.open(url);
    }

    function resize() {
        var h = $(window).height();

        $(".node_para").slimScroll({
            height: h-65,
            size: '4px', //组件宽度
            color: '#eee', //滚动条颜色
            position: 'right', //组件位置：left/right
            distance: '0px', //组件与侧边之间的距离
            start: 'top', //默认滚动位置：top/bottom
            opacity: .4, //滚动条透明度
            alwaysVisible: true, //是否 始终显示组件
            disableFadeOut: false, //是否 鼠标经过可滚动区域时显示组件，离开时隐藏组件
            railVisible: true, //是否 显示轨道
            railColor: '#333', //轨道颜色
            railOpacity: .2, //轨道透明度
            railDraggable: true, //是否 滚动条可拖动
            railClass: 'slimScrollRail', //轨道div类名
            barClass: 'slimScrollBar', //滚动条div类名
            wrapperClass: 'slimScrollDiv', //外包div类名
            allowPageScroll: true, //是否 使用滚轮到达顶端/底端时，滚动窗口
            wheelStep: 10, //滚轮滚动量
            touchScrollStep: 200, //滚动量当用户使用手势
            borderRadius: '7px', //滚动条圆角
            railBorderRadius: '7px' //轨道圆角
        });
    }
    $(window).resize(function () {
        //console.info('resize')
        resize();
    });
    function formatminutes(date){
        $($(".laydate-time-list li ol")[2]).find("li").remove(); //清空秒
    }
</script>
</html>